The premise of the question is only half-true, but to the extent it is true, it's because of quantum effects.
The connection between temperature and kinetic energy comes originally from a classical (non-quantum) result called the Equipartition theorem , which says that for every quadratic term ([math]x^2[/math] or [math]v^2[/math]) in the expression for the total energy of a system, you get an average of [math]\frac{1}{2}k_BT[/math] of energy at thermal equilibrium. So for [math]N[/math] atoms in 3D, you get at a minimum [math]\frac{3}{2}k_BT[/math] of kinetic energy. And, if the atoms are bound together with spring-like bonds, you may get additional units of potential energy up to a total of [math]3N[/math] between kinetic and potential.
However quantum mechanics says this is only true as an approximation when the thermal unit of energy [math]\frac{1}{2}k_BT[/math] is large compared to the quantum unit, [math]hf[/math], where [math]h[/math] is Planck's constant and [math]f[/math] is frequency. At low temperatures, degrees of freedom with high frequency are frozen out and the probability of them having any energy drops off exponentially (see Brian Bi's answer).
So if you have independent atoms, they only have translational degrees of freedom which have an associated frequency of zero (or very small if the gas is in a box) and so you always get the [math]\frac{3}{2}k_BT[/math] per independent atom. But if you group [math]2N[/math] atoms into diatomic molecules, then only [math]3N[/math] of the [math]6N[/math] degrees of freedom are still translational and guaranteed to contribute to kinetic energy. Two degrees of freedom are now rotational, and will contribute [math]\frac{2}{2}k_BT[/math] per molecule only if the temperature is high enough, and one is vibrational and will contribute [math]\frac{1}{2}k_BT[/math] of kinetic energy per molecule plus a bonus [math]\frac{1}{2}k_BT[/math] of potential energy, but only if the temperature is quite high. Thus you get the typical 3/2-5/2-7/2 heat capacity curve shown in Kim Aaron's answer.