Wars are a cost center. The US is eventually going to have to start redirecting tax revenue back to taxpayers, away from the military.
As to your other point: my calculation results in an average. Total spending on defense divided by total spending gives you the average spending on defense as a percentage of average spending at local plus state plus federal levels.