Joule–Thomson effect: why does temperature decrease during expansion
In order to expand, the molecules may do work, such as pushing against a piston, pushing against the container (as in water rockets), spinning a turbine, etc. Energy is transferred from molecular motion to another form, so the temperature drops.

In free expansion, however,


  the gas does no work and absorbs no heat, so the internal energy is conserved. Expanded in this manner, the temperature of an ideal gas would remain constant, but the temperature of a real gas may either increase or decrease, depending on the initial temperature and pressure.


[from Wikipedia].