The reason that energy is conserved is because of Noether’s theorem, which essentially states that for every symmetry of a system (e.g. transformations that leave its dynamics unchanged) there is a corresponding conserved quantity.
Time translation symmetry (i.e. physics not caring when something happens; the laws of physics remaining constant over time) implies energy conservation, via Noether’s theorem. Universal expansion breaks time translation symmetry, since the spacetime underlying the Universe is changing over time. Thus, energy conservation is broken, and the energy is actually destroyed.
(On human timescales, the energy lost is negligible, and energy conservation is a reasonable assumption, but on the scale of millions/billions of years, it becomes significant.)
In fact, general relativity makes no attempt to conserve energy; energy density isn’t even constant between reference frames. What it does say is that the stress-energy-momentum tensor is divergenceless: $\nabla_\nu T^{\mu\nu}=T^{\mu\nu}_{;\nu}=0$.