The reason is that all those other things create actual value, thus cutting into profits of capitalists if publicly funded. If you're a capitalist state that wants to steal massive amounts of wealth from the people and redistribute them to the rich by funding an Industry, then war really is the industry you want because it only destroys value. For example, if you cancelled the Pentagons budget and funded centrally planned healthcare instead, no private healthcare provider could compete. It would completely close down a huge market. Same with education, infrastructure, etc. War doesn't have this problem of closing down a market, but has the advantage of opening up new markets (resources, cheap labour, more consumers, even rebuilding after the war, etc.) via imperialism.
Edit: In short, imperialism is in part a reaction to the tendency of the rate of profit to fall and offers an opportunity to renew primitive accumulation.
The reason is that all those other things create actual value, thus cutting into profits of capitalists if publicly funded. If you're a capitalist state that wants to steal massive amounts of wealth from the people and redistribute them to the rich by funding an Industry, then war really is the industry you want because it only destroys value. For example, if you cancelled the Pentagons budget and funded centrally planned healthcare instead, no private healthcare provider could compete. It would completely close down a huge market. Same with education, infrastructure, etc. War doesn't have this problem of closing down a market, but has the advantage of opening up new markets (resources, cheap labour, more consumers, even rebuilding after the war, etc.) via imperialism.
Edit: In short, imperialism is in part a reaction to the tendency of the rate of profit to fall and offers an opportunity to renew primitive accumulation.