A bit of free riding is inevitable in a free society. But sometimes you get so much that it ruins things for everyone. To stop the spread of infectious diseases, you need a certain number of the 'herd' to be immune to protect unvaccinated people from the disease's spread. In some parts of the US, after years of (baseless) scaremongering about the MMR vaccine against measles, mumps and rubella, so many parents have now chosen not to vaccinate their children that this herd immunity no longer exists. Until recently they were able to free ride on vaccinated children and avoid the disease, but now measles is staging a comeback.
If it were only the children of these parents who were at risk, we might judge that risking their lives was a price worth paying for parental autonomy, depending on how lethal the disease was. But some children (and adults) cannot be vaccinated for medical reasons or because they are too young, so there is a clear external cost to others.
Because of that, depending on the lethalness of the disease, there is a case for government intervention, but it would still be nice to minimise coercion if possible. KCL academic Nick Cowen suggested one elegant way of doing that:
Modest proposal: pay parents of new borns about £2,000 ($3,000) on completion of all vaccines on a standard schedule, or on submission of a medical exemption certificate (just to be fair to children with genuine vulnerabilities to vaccines).
That should get everyone enrolled apart from the truly rich and stupid, and bring herd immunity (the public good we are looking for) up to scratch. If that doesn't do it, double it. It functions as a good excuse to channel more money to families with young children - think of it as an upfront capital grant. The distribution is so broad that it will have few dead weight losses.
I imagine this would probably work, and it avoids having to put anyone in jail or take anyone's children away from them.