Hot compressed gasses lose heat energy to the ambient surroundings so when released there is less energy than it started with. The deficit causes the temperature to go down. If you compress a gas and release it immediately, the temperature will stay the same except for what energy was lost into the compressor itself.