It’s not the right to healthcare. It’s the right to seek healthcare. Ie, they can’t deprive you of life or liberty without charging you. Restricting you from seeking healthcare deprives you of both.
They used whichever they thought was more likely to get through SCOTUS.