https://www.scribd.com/document/98542275/Scotus-opinion
See page 17 et al.
Roberts inverted logic and twisted himself into a pretzel to call the penalty a tax because he thought it should be one.
Scalia in dissent which should have been the majority opinion skewered that idea.
All water under the bridge now...but its a tax because Roberts said so.