From Chief Justice Roberts’ decision (pdf):
In a democracy, the power to make the law rests with those chosen by the people. Our role is more confined—”to say what the law is.” Marbury v. Madison, 1 Cranch 137, 177 (1803). That is easier in some cases than in others. But in every case we must respect the role of the Legislature, and take care not to undo what it has done. A fair reading of legislation demands a fair understanding of the legislative plan.
Congress passed the Affordable Care Act to improve health insurance markets, not to destroy them. If at all possible, we must interpret the Act in a way that is consistent with the former, and avoids the latter. Section 36B can fairly be read consistent with what we see as Congress’s plan, and that is the reading we adopt.
And a bit more:
If the statutory language is plain, we must enforce it according to its terms. Hardt v. Reliance Standard Life Ins. Co., 560 U. S. 242, 251 (2010). But oftentimes the “meaning—or ambiguity—of certain words or phrases may only become evident when placed in context.” Brown & Williamson, 529 U. S., at 132. So when deciding whether the language is plain, we must read the words “in their context and with a view to their place in the overall statutory scheme.” Id., at 133 (internal quotation marks omitted). Our duty, after all, is “to construe statutes, not isolated provisions.” Graham County Soil and Water Conservation Dist. v. United States ex rel. Wilson, 559 U. S. 280, 290 (2010). […]
If we give the phrase “the State that established the Exchange” its most natural meaning, there would be no “qualified individuals” on Federal Exchanges. But the Act clearly contemplates that there will be qualified individuals on every Exchange.
As we just mentioned, the Act requires all Exchanges to “make available qualified health plans to qualified individuals”—something an Exchange could not do if there were no such individuals. §18031(d)(2)(A). And the Act tells the Exchange, in deciding which health plans to offer, to consider “the interests of qualified individuals . . . in the State or States in which such Exchange operates”—again, something the Exchange could not do if qualified individuals did not exist. §18031(e)(1)(B). This problem arises repeatedly throughout the Act. See, e.g., §18031(b)(2) (allowing a State to create “one Exchange . . . for providing . . . services to both qualified individuals and qualified small employers,” rather than creating separate Exchanges for those two groups).
These provisions suggest that the Act may not always use the phrase “established by the State” in its most natural sense. Thus, the meaning of that phrase may not be as clear as it appears when read out of context.
Scalia, in a notably snarky dissent (the other two dissenters were Alito and Thomas, as you’d expect), said that Obamacare should from now on be called “SCOTUScare.”
Rick Hasen comments:
This means of interpretation is important for a number of reasons. First, it means that a new administration with a new IRS Commissioner cannot reinterpret the law to take away subsidies. Second, it puts more power into the hands of Congress over administrative agencies (and therefore the executive), at least on issues at the core of congressional legislation. Third, and most important as a general principle, it rehabilitates a focus on the law’s purpose as a touchstone to interpretation, over a rigid and formalistic textualism that ignores real-world consequences. If followed through consistently, this principle would greatly improve our statutory interpretation.
Now that this genuinely ridiculous challenge to the law has been shot down, the only viable route for Republicans who want to destroy Obamacare is to win enough elections to do it, either by electing enough Republicans in Congress to overcome a veto, or by electing a Republican president who can allow a lot of leeway for Republican-controlled states to bend Obamacare, or both.