Also upheld was a provision that expands Medicaid coverage to include all adults with annual incomes at or below 133% of the federal poverty level, which is currently $14,404 for an individual. The federal government will pick up the total cost of the expensive expansion for the first three years, after which the funding will phase down to 90%.

The expansion could reduce the number of uninsured adults with incomes under 133% of poverty by more than 11 million by 2019, according to a Kaiser Family Foundation estimate.

But here's the catch: The states can opt out of the Medicaid expansion program, since the court said the federal government can't penalize them by withholding all Medicaid funding. Instead, these states wouldn't get the additional Medicaid money to cover newly eligible enrollees.

And that could mean trouble for many poor adults who are not eligible for Medicaid under the current system but would have qualified under the expansion. (Read: Doctors may have to quit their practices)

It's not known how many states will participate in Medicaid expansion.

Some states have already gotten a jump start on implementing the law's provisions. Since 2010, eight states have received approval to enroll low-income adults into Medicaid, for instance.

However, officials in many states are staunchly opposed to the Affordable Care Act. Some 26 of them challenged the Medicaid expansion, among other provisions, in court.

Wisconsin Governor Scott Walker, for instance, said his state will not start implementing the law until after the November election in hopes that it will be repealed under a new administration.

Medicaid has become an increasingly costly burden for states, especially during the Great Recession, which sent enrollment soaring. Some 62 million people are covered by the public health insurance program.

States got a temporary reprieve from the Obama administration's 2009 stimulus program, which funneled billions of dollars to them to cover public health care costs. But state officials also reduced payments to providers and made other cuts in hopes of saving money.

Now, state officials will have to consider whether to participate in the expansion program, weighing the policy, political and fiscal implications, said Matt Salo, executive director of the National Association of Medicaid Directors.

In states that do opt out, those who are just above the poverty line will be able to buy private coverage through new insurance exchanges. The federal government will help them cover the cost.

"For the lower end of the income scale, the subsidies are very large," Salo said.

But those below the poverty line aren't eligible for the subsidies. So in the states that opt not to expand Medicaid, millions of poor adults will likely be left without insurance.

"There is a gap in coverage for very vulnerable, low income people," said Edwin Park, vice president for health policy at the left-leaning Center on Budget and Policy Priorities.

Some experts believe that states will come under tremendous pressure, particularly from medical providers, to participate in the expansion. That's because they currently have to care for the uninsured poor at their or the state's expense.

If states participate in the expansion program, the federal government will pick up nearly all of the tab. That's a powerful incentive, as is the additional economic impact from the additional federal spending, said Gary Claxton, director of the Health Care Marketplace Project at the Kaiser Family Foundation.

"Probably, at the end of the day, states will want to do it," he said.