As a gas expands, the average distance between molecules grows. Because of intermolecular attractive forces (see Van der Waals force), expansion causes an increase in the potential energy of the gas. If no external work is extracted in the process and no heat is transferred, the total energy of the gas remains the same because of the conservation of energy. The increase in potential energy thus implies a decrease in kinetic energy and therefore in temperature.
A second mechanism has the opposite effect. During gas molecule collisions, kinetic energy is temporarily converted into potential energy. As the average intermolecular distance increases, there is a drop in the number of collisions per time unit, which causes a decrease in average potential energy. Again, total energy is conserved, so this leads to an increase in kinetic energy (temperature). Below the Joule–Thomson inversion temperature, the former effect (work done internally against intermolecular attractive forces) dominates, and free expansion causes a decrease in temperature. Above the inversion temperature, gas molecules move faster and so collide more often, and the latter effect (reduced collisions causing a decrease in the average potential energy) dominates: Joule–Thomson expansion causes a temperature increase.
http://en.wikipedia.org/wiki/Joule–Thomson_effect#Physical_mechanism