But the decision didn't go as far as a lower court that had invalidated the entire overhaul as unconstitutional.
The states and other critics say the law violates people's rights. The Justice Department counters that the legislative branch was exercising a "quintessential" power.
An appeals court and three federal judges have upheld the law, and two have invalidated it. Experts say the debate ultimately will be decided by the U.S. Supreme Court.