Federal defense spending is a bit over 25% of the federal budget. Adding all US government spending together to make the point you're trying to make is highly misleading; any given tax payer likely only pays into one, maybe two state governments in any given year; cuts or spending in other state governments don't effect them. (I would entertain summing an average of local, state, and federal, to compare to, but not all.)
Defense spending is about 15% of the federal budget. Which makes sense, because defense one of the key areas entrusted to the federal government, as compared to state and local governments. Leaving out spending from the layers of government assigned primary responsibility for things like health and education is a deception intended to make defense spending look artificially large.
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.