On Friday, President Obama vetoed the $612 billion National Defense Authorization Act that passed overwhelmingly in both the House and Senate.

The act violated the cap on military spending imposed in the 2011 Budget Control Act by passing an extra $90 billion to the Pentagon through the overseas war fund, which is not subject to the spending cap.

But the Congressional Budget Office estimates that only $50 billion of that would be used for the war, and the remaining the $39 billion would be used to pad the Pentagon's baseline budget — essentially, an accounting gimmick to avoid hitting the spending caps on the Pentagon.

The president vetoed the bill — but not because he wants to cut military spending or end the wars. Last week, he reversed his plan to remove troops from Afghanistan, and he, too, wants to break the defense spending caps. In his own budget proposal, Obama "requested $38 billion above the BCA defense cap."

So why the veto? Not because Congress gave him an extra $39 billion when he only wanted $38 billion, and not because it relies on dishonest accounting tricks to get around the legal spending caps.

No, it's because he wants to repeal all federal spending limits, and Republicans only want to repeal the limits on the military:

Obama’s objection to the bill is tied up in a larger battle with Republicans over federal spending. He wants to lift spending caps for both the Pentagon and other federal agencies — while Republicans are pushing a budget plan that would only lift the caps for the Pentagon.

And the defense authorization bill adheres to the GOP budget plan... The budget blueprint seeks to use the supplemental Overseas Contingency Operations war fund to allow the Pentagon to get around the strict caps on federal spending put in place by the Budget Control Act of 2011, while leaving other federal agencies subject to the caps.

Democrats have dismissed the GOP budget for bolstering the Pentagon at the expense of the rest of the government and are pressing for a deal that would increase the caps on all discretionary spending — the Pentagon along with domestic federal agencies.

Ironically, the president is vetoing a spending bill that gave him more than he asked for — because he wants to use it as leverage to get even more elsewhere. Meanwhile, Republicans are planning to try to override the veto so that they only increase spending on half the discretionary budget.

This is one of those situations where you just have to hope that everyone loses. The good news is that Washington is so dysfunctional that even though the White House, Republicans, and most Democrats all support repealing the limits on defense spending, it still might not happen.

The president won't sign off on giving the Pentagon more than the Budget Control Act allows, unless Congress does it through the normal budget instead of the backdoor. And, just as clearly, he won't sign off on repealing the caps on the normal defense budget unless Congress also repeals the caps on other domestic federal agencies.

So we're basically back to the standoff that led Congress to pass the Budget Control Act in the first place: Republicans want more military spending, but not more domestic spending; most Democrats want to increase military spending too, but they'd like to increase domestic spending even more.

Since they couldn't agree on how to balance the budget, automatic across-the-board spending caps went into place without anyone having to agree. This is why the Budget Control Act is probably the most brilliant good piece of legislation passed in decades: Everyone hates it. Everyone wants to get rid of it. But, so far, the political calculus has made it impossible to repeal.

But, today, the situation is different in one important way: the budget deficit is a third what it was in 2011 — "only" $468 billion this year — which might relieve the sense of urgency that existed back then to slow the growth of spending.

The $4 trillion question is whether enough Republicans still care more about controlling spending than they do about lavishing funding on the military.

If Congress refuses to compromise on domestic spending, and the White House refuses to compromise on backdoor military funding, it seems that the only remaining choice is to pass a defense spending bill that actually complies with the law's spending cap — the one outcome that nobody wanted, but the one that is least bad for the taxpayer and the government's overall fiscal situation. Two cheers for gridlock!