One thing that’s usually left unsaid during debates about the US military budget is that it’s a jobs program. Wanna cut it? Wanna close bases and do away with weapons programs? Ok, how many jobs are you willing to cut along with them, and how many communities are you willing to negatively impact when the jobs from those bases and programs are eliminated? Not saying it can never be done, but it’s not as easy as the usual rhetoric that talks about the “bloated defense budget,” where every dollar for a bomb just becomes healthcare/education money. It’s more complicated than that.Once you have committed to funding and maintaining a sizeable peacetime military force, you find there are all kinds of neat things they can do, in peacetime. In war, of course, everything changes.
However, in a post-scarcity society, a lot of those aspects would be much different. Presumably, San Francisco doesn’t host Starfleet Command because of the jobs and economic investment it brings to the area, because there’s no money and no need to worry about job growth since there’s no poverty.