President Obama’s decision to veto a $612 billion defense spending bill sets the stage for a fight that could force Congress to put an end to an era of fiscal mismanagement. It is a battle the president, who has vetoed only four other bills, may lose. But it’s one well worth fighting.

Mr. Obama and Congress agree on the funding level for the Pentagon’s budget for the 2016 fiscal year. But the White House is rightly rejecting an irresponsible device lawmakers want to use to circumvent spending caps imposed by a deficit-reduction mechanism that has been in effect since 2013.

Both parties would like to bust through the caps, known as sequestration, but the president has insisted that spending on domestic programs be raised at the same time and that the process be open and free of gimmicks. Instead, to sidestep the caps, lawmakers added $38 billion to the defense budget by allocating the money to a war operations fund that is not subject to the spending ceiling. The budget line for Overseas Contingency Operations, which was created to support the ground wars in Iraq and Afghanistan, has become a slush fund that lawmakers routinely use to divert money for dubious initiatives in their home districts.

The bill also retains the unreasonable provisions that have stymied the administration’s plan to shut down the military prison in Guantánamo Bay, and includes new ones that are even more onerous. Under the bill, any new release from Guantánamo would require the secretary of defense to certify to Congress that the move is in the national interest of the United States and that the country the detainee is being transferred to has taken “appropriate steps” to prevent him from joining terrorist groups.