The Supreme Court has also ruled that people can be forced to pay into Social Security. But I’m not sure that the government can force people to buy insurance from a private company. Which, I suppose, is one reason why the Democrats are so big on a public option.
Nitpicky distinction: the Supreme Court held that the Social Security payroll tax is not unconstitutional. But, that tax doesn't constitutionally obligate the government to pay you anything in return. You're taxed, and then when you're old, there's another government program that sends you checks. As far as the Court was concerned, the SS tax is just like any other federal income tax.
Thus, the SS payroll tax survives under the government's taxing power, and the SS benefits program survives under the government's spending power. The unbelievably massive flaw in this scheme is that Congress is fully empowered to collect SS taxes from you for decades, and then pay you nothing in return. This is just one reason why SS is a terrible program.
Mandated health-insurance purchasing laws, however, wouldn't be able to pass muster under the taxation or spending powers of Congress. I imagine that's why Hoyer is trying to claim it's a 'general welfare' power.