Where does energy conservation come from? In modern understanding, energy is the Noether charge of time translation symmetry, as found by Noether's first theorem. But in general relativity, the metric is dynamical, and so in general we simply don't have any time translation symmetry. Static spacetimes do, and there is also a form of energy conservation for spacetimes that regain time translation symmetric far away from the gravitating system (e.g. ADM energy of asymptopticallyasymptotically flat spacetimes). But those are the exceptions, not the rule.
Addendum: It's notable that there is yet another sense in which the total energy of the a spatially finite universe is exactly zero. Intuitively, one can try to measure the content inside some closed surface, and then expand that surface to try to enclose everything in the universe. However, for a closed universe, that surface will contract to a point, thusethus enclosing nothing (picture a circle around the north pole of the Earth, and expand it to try to enclose all of Earth's surface--it just contracts to a point at the south pole).