it is meant to protect the transistors inside the regulator when it is being used in a high capacitance circuit
for example, lets say you have a huge output capacitor for some reason, and then your Vsup disappears for some reason (crowbared) - now the output side if the reg is at a higher potential than the input side, so current will want to flow from the output cap, through the reg, reverse biased ... the datasheet explains how to calculate wether or not you need that diode, as the reg have some built in protection.
so, with the diode there, if the output somehow reaches a higher potential than the input, the diode becomes forward biased and conducts the excess voltage safely around the reg.