The usual way of deriving the equipartition theorem is through the 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 rotationalrotational symmetry, and 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 at the same thing in the language of time averages, the situation doesdoes 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 energyenergy. If the motion can be confined only along one coordinate directiondirection, the system is not ergodic. That would be the case ofwith the ideal gas. However, even if sometimes it is not explicitly stated, the application of statistical mechanics to the ideal gas implicitly assumes that some additional mechanism whichthat ensures ergodicity is present, even though not appearing explicitly in the Hamiltonian (for example, one could imagine that a microscopic roughness of a thermalizing confining wall couldcould be a sufficient source of chaotic motion to make the system ergodic).