LM317 voltage regulator R2 is getting very hot? why?

AMPs am CURRENT,,, It's Voltage , Resistance, and Current (in AMPs).
The 1.25 V and 50uV (not 5mV) are what is passed by the Adjust pin of the regulator. You can read the datasheet to find out how it works. But that current path is totally different from the reference loop setup by R1 and R2. That sets the Highend voltage the regulator will pass. with proper heat sinking, the 317 will pass a max of something like 1 AMP, as long as you source it with Vin=Vout+1.25V, or more and at least 1 AMP.