Beyond that, we perceive a benefit from stationing troops in those countries; it’s not a case of “Rent-A-Military”, and nor are we footing the entire bill for these bases in most cases anyway.
So in the case of Japan, it’s cheaper for them to pay us to station our troops in their country- they just pay a proportion of upkeep, without all the costs associated with training, R&D, etc… And along with that, it costs us less to station the troops there than in the US.
So both sides benefit financially, and both sides benefit militarily- we get to have troops in place to deter N. Korea and China from any sort of crazy adventurism, and the Japanese benefit from that as much or more than we do.
Like others have said, the ability to project power is a Great Power kind of exercise, and I suspect the ability to extend power like the US does is more of a superpower kind of exercise.
The reason to be a military superpower as I see it, is linked with our stature as the de-facto economic superpower. If we want to keep the latter status, we need the military ability to deter anyone from messing with it unduly, and the ability to compel anyone messing with it to stop forthwith.
I mean, the Persian Gulf and Straits of Hormuz are a big choke-point for a lot of the world’s oil, and it benefits the US to maintain a presence there to dissuade the Iranians or other countries from interfering with that flow of oil tankers. It also benefits us to maintain a military large enough to stomp the crap out of any nation fool enough to try and cut that off or substantially interfere with it.
Would we prefer that China or Russia be the shepherd of the world’s oil trade routes? Can their navies handle it? Would they be as good of stewards as we are? Would it be as beneficial to the US and world economies as if the US does it?
Probably not, and that’s why we do the things we do w.r.t. military basing in other countries.