LM317 Voltage Regulator + ammeter = firecracker?
If you had a short in place of the potentiometer, you should have read 1.25 volts (or so) at the output of the LM317, not 12.5 volts.

When you changed your meter to read current, presumably moving the red lead to the "10 Amp" socket, the meter would have very low resistance.  When you then connected the meter between the LM317 output and ground, a very large current would flow, apparently causing the LM317 to explode.

If I recall correctly, the LM317 is spec'd to deliver 1 amp, with due regard to voltage drop, power dissipation, heatsinks and phase of the moon - that only states the current that it can safely carry under suitable conditions - it DOES NOT limit the current to that value!

The current measurement function of a multimeter should only be used with the meter connected in series with a load whose current drain you wish to measure.  It must NEVER be connected directly across a power supply.