The matiematical reason is that the mode shapes are orthogonal. If ##x_i## amd ##x_j## are two different modes (## i \ne j##), then ##x_i^TMx_j = 0## and ##x_i^TKx_j = 0## where ##M## and ##K## are the system mass and stiffness matrices.
You can express any motion of the system as a linear combination of all the modes, i.e.
$$x = \sum_i a_i x_i.$$ So the total strain energy of the system is
$$x^T K x/2 = (\sum_i a_ix_i)^T K (\sum_j a_j x_j)/2
= \sum_i\sum_j (a_ia_jx_i^T K x_j)/2 = \sum_i (a^2_i x_i^T K x_i)/2$$because the only non-zero terms are when ##i = j##. The same is true for the kinetic energy.
The math proof that the modes are orthogonal requires quite a bit of linear algebra, and may be just assumed, or demonstrated by a numerical example, in a first course in dynamics. For practical engineering work, knowing the result is true is a lot more important than knowing how to prove it!