You should keep in mind that such huge spending for military is, in it's larger part, useful for the economy. Soldiers and staff get paid,various government contractors and factories produce weapons and other equipment and also get paid, and new technologies are developed.
Of course you can say that the money spent on military could have been directly invested into various projects of public interest. That may be true, but then what would happen if someone crazy got to power in, say, Russia or China?