In Maxwell's demon, why are all the cold gas molecules on the same side?

Individual gas molecules are neither cold nor hot: They have kinetic energy.

The absolute temperature of a gas is proportional to the average of the kinetic energies of its molecules, and what's important here, is that the kinetic energies are not all the same. There is a statistical distribution of different energies in any given body of gas. Even so when the gas is all one "temperature."

https://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_statistics


Suppose, initially the gas on both sides has the temperature $T_0 = 273K$. In thermal equilibrium the velocity distribution of each side is given by the Maxwell-Bolzmann distribution enter image description here The average velocity is around $\bar v = 1500m/s$.

Now, suppose that only the particles with veclocity $v>2500m/s$ are allowed to pass from the left to the right chamber. Since the average velocity of these particles is higher than the overall average velocity $\bar v$, these particles carry energy from the left chamber into the right chamber. Thus, after rethermalisation the temperature on the left side has reduced, say to $T_1^{(left)}=270K$, while the temperature on the right side has increased, say to $T_1^{(right)}=276K$.

While this concept is forbidden in the context of Maxwell's devil, it is effectively at work in ultra-cold atoms labs around the world: Trapping atoms in either magnetic or an optical dipole potentials, and removing only the high energetic atoms of the trap, we reduce the temperature of the remaining atoms. Another example for this so called evaporation cooling is your coffee mug.