The liberal justices who blocked it said it was because of his campaign rhetoric that made it unconstitutional, that if Obama did it it would have been constitutional.
Early on I read something about “the four corners” principle that simply meant they court cannot take into account campaign statements, just the 4 corners of the paper the law is written on.
Funny how Obama publicly stating the Affordable Care Act was not a tax but arguing in.court that it was a tax didnt matter.