And who said that “a provision that may seem ambiguous in isolation is often clarified by the remainder of the statutory scheme” because “only one of the permissible meanings produces a substantive effect that is compatible with the rest of the law”? Why, Justice Scalia again.

“In this instance,” Chief Justice Roberts wrote, “the context and structure of the Act compel us to depart from what would otherwise be the most natural reading of the pertinent statutory phrase.” He concluded: “A fair reading of legislation demands a fair understanding of the legislative plan.” Among the chief justice’s silent partners in the six-justice majority opinion was Justice Kennedy, by most accounts the driving force behind the near miss three years ago.

What happened between November and now was no accident. Ordinarily, as a party in a major Supreme Court case, the federal government doesn’t bother to do what private parties do routinely: mobilize organizations and well-credentialed individuals to support the position from different perspectives in briefs filed as “friends of the court.” But this time, fully aware of the stakes, the government rounded up dozens of such friends. The chief justice cited two of those briefs in his opinion, one from the health insurance industry and the other, which he referred to several times, from the country’s leading experts on the economics of health care.

The government’s side spoke not only with authority but also with a sense of urgency about the consequences of the law’s failure. Outside the court — inside the Beltway, especially — voices rose in what both The Hill and Politico properly called a frenzy. The Supreme Court’s marble walls are thick, but they aren’t that thick.

And so a case that once looked easy, almost cost-free, became a trap. Justice Scalia derided the majority opinion as a “defense of the indefensible.” But what would be truly indefensible, I believe the chief justice and Justice Kennedy came to understand, was the Supreme Court itself, if it bought a cynically manufactured and meritless argument and thus came to be perceived as a partisan tool.

This whole exercise was unnecessary, the outcome too close for comfort. But there is cause for celebration in a disaster narrowly averted — for the country and the court, which is to say, for us all.