There's the knockout argument "energy is not conserved in general relativity", but that doesn't address the question. So let's neglect gravity for the sake of clarity, and look at expansion in this toy model.
If you had an ideal gas everywhere, it wouldn't be expanding. Its density and temperature would be constant.
If you had a finite bubble of gas in otherwise empty space, it would start expanding. It's easiest if we neglect interactions and let each molecule float freely:
Only when the fastest particles from the edge of the cloud have passed the observer, and are gone forever, the expansion becomes noticeable. The gas will become locally nonthermal, as it separates according to particle speed (the fastest particles leaving first), and the local kinetic energy of the particles will in fact decrease. "Local kinetic energy" means the energy of some neighbouring particles as measured in the frame of their center of gravity. So, while the total energy is conserved and the total temperature is constant, at each position you measure smaller relative velocities and smaller temperature (if applicable).
That's because the irregular motion of the initial cloud becomes partially ordered by the expansion, such that you'd locally count part of the kinetic energy as due to bulk relative motion (wrt other parts of the cloud), not as thermal energy. If you'd stop the expansion (say, by placing a box around the cloud), the gas would get mixed again, there will be no local net motion, and all the energy would be attributed to thermal motion again.
And that's quite exactly what happens on an cosmic scale. For an infinite cloud to expand, you'd have to add some underlying motion to the thermal one, such that the average velocity increases proportional to distance. In such a gas, the locally measured temperature would decrease, because more and more of the kinetic energy would be in ordered "net motion", not in unordered thermal motion.