THE SUPREME COURT’S 5 to 4 decision upholding the core of the Affordable Care Act is good news for the court and the country. Chief Justice John G. Roberts Jr. was statesmanlike in choosing to side with four more liberal justices in finding that the law’s most controversial provision, the mandate that individuals obtain health insurance, was a constitutional exercise of Congress’s power “to lay and collect taxes.” That solution allows the main provisions of the law to take effect. Even more important, it is respectful, as the court should be, of congressional authority and the democratic process that underlies it.

At the start of the majority opinion, which he authored, Justice Roberts noted that policy judgments “are entrusted to our nation’s elected leaders, who can be thrown out of office if the people disagree with them. It is not our job to protect the people from the consequences of their political choices.” The chief justice and four other conservative justices found that the requirement to purchase insurance exceeded congressional authority to regulate interstate commerce. But rather than use that finding to invalidate the law, as his four colleagues would have done, Justice Roberts cited precedent that instructs the court to resort to “every reasonable construction” that may “save a statute from unconstitutionality.”

In so doing, he also protected the court itself. It avoided playing the uncomfortable role of overturning a legislative solution four decades in the making, full of choices and tradeoffs among competing approaches and goals.

We believe that the individual mandate was an appropriate exercise of Congress’s authority to regulate commerce, but also that the question of compelling individuals to purchase a product raised novel issues and a difficult quest for a limiting principle. Broccoli, anyone? The chief justice rejected the government’s argument that compulsion in this case was justified by the uniqueness of the health-care market.

The liberal dissenters, in an opinion by Justice Ruth Bader Ginsburg, argued that the majority’s “rigid reading of the [Commerce] Clause makes scant sense and is stunningly retrogressive”; the individual mandate, they argued, “addresses the very sort of interstate problem that made the commerce power essential in our federal system.” It remains to be seen, however, whether the dissenters’ worry about “hem[ming] in Congress’ capacity to meet the new problems arising constantly in our ever-developing modern economy” will be borne out in future cases.

In the only defeat for the administration, the court curtailed the government’s power to compel states to expand coverage under the joint federal-state Medicaid program for the poor. Under the law, a program until now aimed at covering mostly poor children and families will be expanded to require coverage of childless adults making up to 133 percent of the federal poverty level. The federal government will pay 100 percent of the costs of expanded coverage through 2016 and a minimum of 90 percent in later years. Yet seven justices found that Congress went too far in threatening to take away all Medicaid funds from states that didn’t go along with the expansion.

How much impact this will have on Medicaid coverage is not clear: The deal being offered to states is so attractive that many will take it even absent that threat. But in terms of legal significance, this restriction of federal authority may have greater ramifications than the court’s limiting of the Commerce Clause. One can imagine challenges to federal conditions across a wide spectrum of programs, including but not limited to the environment, education and transportation.

That the legal questions surrounding the health-care law have been resolved, and in a way that will permit it to take effect, is welcome but only the beginning of the process. Republican presidential candidate Mitt Romney has vowed to make repeal of “Obamacare” a top priority if elected; that is certainly within the prerogative of a new president and Congress. It would be unfortunate, however, if governors opposed to the law take the looming election and the possibility of repeal as a license for dawdling. The responsible course for states is to use this time to lay the groundwork for insurance exchanges that are supposed to be up and running in 2014.

Even if President Obama is reelected, many practical questions remain. Is the penalty — now tax — imposed on those who fail to obtain insurance big enough to induce the uninsured to buy coverage? Are insurers permitted to charge different enough premiums based on age? These, and many more, are important practical questions whose answers will become known only now that the court, wisely, has allowed the law to go forward.

In an editorial Thursday, we said that many Americans would be watching the court to see whether, at a time of extreme partisanship, it could craft a decision that impressed as an act of law, not politics. In our view, the court passed that test of legitimacy. Now the arguments over Obamacare can continue where they are best fought out, in the political arena.