CJ Roberts rescues the mandate by noticing that it’s a tax.  Here’s the key line in the dissent of the minority, Kennedy, Scalia, Alito, and Thomas:

The issue is not whether Congress had the power to frame the minimum-coverage provision as a tax, but whether it did so.

The full decision is here.