Why do you reduce the choices between "building useless piece of hardware" and "bombing innocent people" ? There are lots of choices here. Just a sample : less tax or invest more in health and education.
The military industrial complex in the US is a self-perpetuating system that just so happens to have the influence and lobbying power to get the funding.
It would have been great if some harmless or even beneficial industry had developed in this way, but that is not the case unfortunately.
The US also has a burgeoning prison-industrial complex which also, unfortunately, results in bad consequences for innocent people.
You can see these self-perpetuating systems all over the place in modern civilization. The mechanism by which they grow is the same one which causes management in large corporations to grow exponentially. The bureaucracy will grow to fill the resources available.
In the case of these self-perpetuating systems, they can grow in lobbying power and influence and increase their available resources, which allows them to expand and gain even more lobbying power and influence, and so on.
The core business could be military, or making fake vomit, it doesnt matter.
ps. 'self-perpetuating system' is just a term I use to talk about these things. Maybe theres a widely accepted term I dont know. Also all this is just a product of my own reading and ruminations.