The LM317 has a high gain compensated opamp inside. The compensation causes 90 degrees of phase shift. If it is in the negative feedback loop of a similar opamp like a 741 then the phase shift adds to 180 degrees at high frequencies and the combination will oscillate.