The usual way of deriving the equipartition theorem is through manipulation of an *ensemble* average. Equilibrium ensemble probability densities in phase space depend on the canonical coordinates through the Hamiltonian. The kinetic part of the Hamiltonian of a system of $N$ particles in the 3D space has the complete rotational symmetry, therefore, at the level of probability density, it is impossible to have any unbalance between $x$, $y$ or $z$ directions of the velocity distribution. Looking the same thing in the language of time averages, the situation does not change. If time averages can be written as ensemble averages, the system must be ergodic, which means that no additional constant of motion exists, beyond energy. If the motion can be confined only along one coordinate direction, the system is not ergodic. That would be the case of the ideal gas. However, even if sometimes it is not explicitly stated, application of statistical mechanics to the ideal gas implicitly assumes that some additional mechanism which ensures ergodicity is present, even though not appearing explicitly in the Hamiltonian (for example one could imagine that a microscopic roughness of a confining wall could be a sufficient source of chaotic motion to make the system ergodic).