They don’t use energy because, from the perspective of the magnets, opposing poles closer together is a lower energy state than further away; the universe is constantly moving things from higher energy states to lower energy states.
Unfortunately, this is one of those “just the way things are” kind of things that doesn’t have a particularly deep or meaningful answer. It’s just easier for opposing charges to exist closer than further. Someone mentioned gravity and that’s the best example. We don’t usually think of objects and the Earth as a system pulling on each other, but that’s the case. The same way it takes effort to lift something but it’ll fall without any effort, opposing charges require effort to separate and will fall together if unopposed.
Latest Answers