Washington (CNN) Donald Trump is not going to like his Constitution 101 lesson: "Presidents are not kings."

A federal judge's stunning rebuke of the White House on Monday came as the result of a case by House Democrats to force former White House counsel Don McGahn to testify. But it serves as a thematic frame for an entire presidency that has never played by the rules.

All of Trump's scandals are fusing together into a momentous fight over his staggeringly broad claims of expansive presidential power. How it turns out will shape his personal political legacy, the nature of the office he has held for nearly three years and potentially the American political system itself.

How much power does a President have? And how long can the governing institutions that he has incessantly challenged stand his wielding of instinctive yet often-erratic executive authority?

The White House on Monday walked away from its latest battles over presidential power with a loss, a temporary win and a bunch of new legal battles.

McGahn ordered to testify

Kicking off a frenzied half hour in Washington on Monday night, federal Judge Ketanji Brown Jackson ordered McGahn to testify before the House of Representatives, which has been trying to force his appearance since April over Mueller's findings that suggest Trump obstructed justice in the Russia investigation. Jackson dismissed the President's claim that McGahn was subject to blanket immunity.

Getting right down to the basics that most Americans learn in school, the judge quoted Founding Fathers James Madison and Alexander Hamilton and French diplomat Alexis de Tocqueville to explain the nature of the presidency.

"Stated simply, the primary takeaway from the past 250 years of recorded American history is that Presidents are not kings," Jackson wrote.

"It is indisputable that current and former employees of the White House work for the People of the United States, and that they take an oath to protect and defend the Constitution of the United States," the judge added.

The Justice Department quickly said it planned to appeal the ruling, which has profound implications for the impeachment inquiry, since Trump has launched a similar effort to prevent administration officials from testifying under another sweeping claim of presidential immunity.

Though after five days of public hearings in the impeachment inquiry, public opinion over whether the President ought to be impeached and removed from office remains exactly the same as it was in October, according to a new CNN poll conducted by SSRS.

Minutes after Jackson's legal lecture emerged, Trump got a win of sorts -- as the Supreme Court blocked the immediate release of his financial records to a House committee, to allow his lawyers to file a brief arguing why the nine justices should take the case.

The legal fight is likely to create another reverberating precedent on the nature of presidential power, since it will test whether a president can refuse Congress' legally mandated request for the president's financial records -- a duty it can impose on regular American citizens.

Trump vs. the Pentagon

The legal drama erupted on a day when Washington was already waging a debate about the extent of presidential authority.

This time it was over a clash between a President who never plays by the rules and an institution -- the military -- that can't exist without them.

Trump's shielding of Navy SEAL Eddie Gallagher, who had posed with the corpse of a young ISIS fighter, led to a bewildering set of events that have yet to be explained and the firing of yet another senior official, Navy Secretary Richard Spencer.

This was a moment when it was the Pentagon's turn to get trampled by Trump, casting a shadow over the rule of law in pursuit of a big, personal, political base-pleasing win.

Like the State Department, the Justice Department and the intelligence community, the fortress across the Potomac found that traditions, rules and decorum mean little to the President. In one way, the controversy actually offered Washington some relief Monday from the incessant impeachment drama that has dominated the last two months.

But at its root, the new storm shares a theme with the allegations that Trump abused his power and went behind the backs of US diplomats to get a political payoff from Ukraine.

In both cases, Trump seems to have used his authority as President to benefit his reelection campaign rather than to safeguard a traditional interpretation of US interests. In the Gallagher case, he ignored the structure of military justice. In Ukraine, he constructed a back channel to get a foreign power's political help in defiance of regular State Department channels.

Trump's entire time in office could be viewed as a struggle between the rules and customs that govern the presidency and his attempts to stretch such guardrails to their limits.

This has led to constant tension between the executive and the courts and Congress, especially as a Democratic-led House sought to honor its oversight and investigative function.

Trump claims his political reward

There is no doubt that Trump, as commander in chief, has the power to reverse the demotion of Gallagher, and to pardon two other soldiers accused of war crimes, as he did last week.

But the question becomes: Does his action serve the military, the reputation of America's servicemen and women, and the nation's image as a land of laws and military honor?

Gallagher was subject to a rigorous military legal process. He was acquitted of attempted murder, premeditated murder and obstruction of justice. It's hard to argue that he didn't get due process and fair treatment from the military.

But Trump left little doubt in an exchange with reporters Monday afternoon that he was seeking a political reward for ordering Defense Secretary Mark Esper to restore Gallagher's rank.

"I think what I'm doing is sticking up for our armed forces. And there's never been a President that's going to stick up for them and has, like I have," Trump said.

Trump has sharp political instincts. He knows that backing the troops is rarely bad politics. Critics of Trump's conduct risk being accused of siding with a dead terrorist over a certified American war hero.

"He was a great fighter. He was the -- one of the ultimate fighters. Tough guy. These are not weak people. These are tough people," Trump said Monday, driving the point home.

Yet there is dismay at Trump's action among senior military officers within the Pentagon, who see it as undermining the entire code of military justice, CNN's Barbara Starr and Ryan Browne reported

It raises the prospect that Trump could choose to intervene anytime a US service member is accused of committing war crimes, leading to a culture of impunity in the ranks.

But no one could say Trump's support for Gallagher is out of character. All his life in business and his political career, he has treated the law and behavioral rules of the road as an inconvenience to be stretched for him to get his way.

"I don't think we ought to lose sight of the very central point here," Ray Mabus, who served as Navy secretary in the Obama administration, told CNN's Brooke Baldwin on Monday.

"None of this would have happened, not a bit of it, if the President had not inserted himself, absolutely inappropriately, in a way that undermines military justice in a way that dishonors the military that serves without committing war crimes," he added.

Spencer, meanwhile, left a blistering resignation letter in which he laid the extraordinary charge that the President is abusing his powers -- a warning that applies to any number of controversies raging in Washington.

"I no longer share the same understanding with the Commander in Chief who appointed me, in regards to the key principle of good order and discipline," he wrote. "I cannot in good conscience obey an order that I believe violates the sacred oath I took in the presence of my family, my flag and my faith to support and defend the Constitution of the United States."