IMO,it's FAR less costly to fight wars and battles overseas than to wait until they're waging war inside the US. Pearl Harbor occurred before we had bases or forces in Asia.
Plus having bases overseas gives us a faster response time,even for natural disasters,like the Pacific tsunami of a few years ago. The US was first on the scene and with the most aid.
We had no dealings in Afghanistan,yet it was used as a base to attack New York and the Pentagon,killing about 3000 people and causing billions in economic damage.
In today's world,even non-state groups can cause huge damage to a nation.