Here is the relevant section of Chief Justice John Roberts' majority decision upholding the individual mandate as a tax:
It is well established that if a statute has two possible meanings, one of which violates the Constitution, courts should adopt the meaning that does not do so.....If the mandate is in effect just a tax hike on certain taxpayers who do not have health insurance, it may be within Congress’s constitutional power to tax.
The question is not whether that is the most natural interpretation of the mandate, but only whether it is a “fairly possible” one. As we have explained, “every reasonable construction must be resorted to, in order to save a statute from unconstitutionality.”
....It is of course true that the Act describes the payment as a “penalty,” not a “tax.”....That choice does not, however, control whether an exaction is within Congress’s constitutional power to tax. [A bit of analysis follows about past precedent that controls whether something is really a tax or not.]
....The same analysis here suggests that the shared responsibility payment may for constitutional purposes be considered a tax, not a penalty: First, for most Americans the amount due will be far less than the price of insurance, and, by statute, it can never be more....None of this is to say that the payment is not intended to affect individual conduct. Although the payment will raise considerable revenue, it is plainly designed to expand health insurance coverage. But taxes that seek to influence conduct are nothing new.
Yes indeed. Taxes are designed to influence conduct all the time. That's nothing new.