I prefer to think of military spending during peacetime as "peace spending" not "war spending".
Spending on actual wars, once they start, is another matter. Some wars are just (like the support of Ukraine, at present, I would say, or the liberation of Kuwait), some are unjust, many are some shade of gray.
But generally, it is preferable when democratic countries have enough military might during peacetime to make would-be conquerors put aside their dreams of being the new Peter the Great, Saladin or Qin Shi Huang.
Peace is relative. The US has not had war on its own territory since the Civil War, so the civilian population has experienced peace for over 150 years.
During WW1 and especially WW2, the US military was employed to nearly maximum capacity, in other words, 1945 was the last time the military was in a state of all-out war.
During the Korean and Vietnam wars, the military was partially committed to the wars, maybe around 25% of 1945's commitment. I would label these limited wars.
The invasion phases of the two Iraqi wars as well as the invasion phase in Afghanistan saw similar levels of mobilization, but these were over so quickly they would be more like skirmishes.
And for the rest, I would label them as little more than policing of occupied territories.
(All of the above from the US perspective, from the perspective of the adversary, several of the above were total wars.)
If you look at the death toll, WW2 cost 0.4% of the US population at the time. The Vietnam and Korean wars cost less than 0.1% of the population each, and the rest hardly register.
Compare that to the 5%-20% death toll of many European countries during WW2, and similar numbers for numerous other wars through history, and you get a perspective of how peaceful the US has been since the Civil War.
I prefer to think of military spending during peacetime as "peace spending" not "war spending".
Spending on actual wars, once they start, is another matter. Some wars are just (like the support of Ukraine, at present, I would say, or the liberation of Kuwait), some are unjust, many are some shade of gray.
But generally, it is preferable when democratic countries have enough military might during peacetime to make would-be conquerors put aside their dreams of being the new Peter the Great, Saladin or Qin Shi Huang.