Deterrence can very often shape behavior. Addictive behavior can be discouraged with legal disincentives. Sexual promiscuity involving high-risk intercourse can be discouraged with harsh prohibitions. Addiction exists on a spectrum, and those further from the extreme addiction end can often be discouraged through strong-arming social intervention.
But for the vaccine mandate supporters, who oppose laws to hold accountable people who burden the healthcare system through over-eating, drug and alcohol abuse or high-risk sexual activity, virtue signalling is more important than saving lives, or punishing MAGA types is more important than respecting rights. Hence the inconsistency.