The aim of D5 is to protect the voltage regulator against reverse voltages. If the output is placed at a voltage higher than the input a reverse current can flow through the LM317 potentially damaging it. This could happens, for instance, when you switch the power supply off: if the output capacitor (C1) is discharging slower with respect to the input capacitor (C3).
Probably in your case is not really needed.
Why is the secondary of the transformer rated at "15V-0-15V" which is a total of 30VAC? Then the rectified and filtered voltage at the input of the LM317 is 42VDC or higher if the current is low! Instead the secondary should be 12VAC to 15VAC. Then the filtered but unregulated voltage feeding the LM317 will be a minimum of 15VDC which is fine for an output of only 12VDC.
Why is the main filter capacitor C1 value only 470uF? Then the ripple will be high when the current is more than a small amount.
Why is R2 as high as 220 ohms which is used with the more expensive LM117 as shown on the datasheet? Then some LM317 ICs will raise the output voltage when the load current is low. R2 should be 120 ohms with an LM317 then the minimum load current is enough to prevent the problem. But the other resistor values must be re-calculated.
Why is the secondary of the transformer rated at "15V-0-15V" which is a total of 30VAC? Then the rectified and filtered voltage at the input of the LM317 is 42VDC or higher if the current is low! Instead the secondary should be 12VAC to 15VAC. Then the filtered but unregulated voltage feeding the LM317 will be a minimum of 15VDC which is fine for an output of only 12VDC.