It's been that way for a long time. I know my mom couldn't enroll me in school in the 1970's without me having my vaccine records up to date. They didn't "force" me to take them, but if I didn't I couldn't go to school. Likewise the government can't force you to get an ID, but try and go through any day without having one and you'll quickly find it's almost impossible. You can't drive, cash a check, buy prescriptions, or buy beer without one.
But you can vote.
About a decade ago the state of Texas and other regional governments where plotting to mandate that young girls (no boys) get the HPV vaccine (before they became sexually active).
Men can get cancer as well from HPV but it was promoted as “A womens’ issue” to stile debate.
Rick the Prick Perry got slammed by Republicans for trying to make it manditory.
So governments can very well mandate such crap and it isn’t even always “for the children”/public health.