I'd argue that the whole purpose of a state is to shift game theoretic weights of decisions of individuals in a way that benefits the overall population. So we don't fall into certain instances of the "tragedy of the commons" [1].
Vaccination is a good example. As an individual there is a really small risk in not vaccination if everybody else do otherwise (the disease can't spread). If there is no regulation then the Nash equilibrium will be at a not desirable point, where a certain percentage of people still don't vaccinate and the disease never dies out. If there is a regulation it can increase the cost of not vaccinating (most easily you pay a high amount of fine and you still have to vaccinate) and shifts the Nash equilibrium to a more effective point.
tl;dr: you don't vaccinate only for yourself and your kids, you vaccinate for everybody stopping the spreading of the disease.
edit: Note that making vaccination mandatory is not the only (but IMHO an effective) way to motivate vaccination. The state can reward people who take vaccination.
I can't/shouldn't take the flu vaccine... it will drastically the risk (around 5% without flu shot) that I'll have Guillain-Barre again. I'm almost done paying the hospital bills from 5 years ago, when it happened... insanely expensive treatment, even if you have insurance that caps at half a million.
Vaccination is a good example. As an individual there is a really small risk in not vaccination if everybody else do otherwise (the disease can't spread). If there is no regulation then the Nash equilibrium will be at a not desirable point, where a certain percentage of people still don't vaccinate and the disease never dies out. If there is a regulation it can increase the cost of not vaccinating (most easily you pay a high amount of fine and you still have to vaccinate) and shifts the Nash equilibrium to a more effective point.
tl;dr: you don't vaccinate only for yourself and your kids, you vaccinate for everybody stopping the spreading of the disease.
[1] https://en.wikipedia.org/wiki/Tragedy_of_the_commons
edit: Note that making vaccination mandatory is not the only (but IMHO an effective) way to motivate vaccination. The state can reward people who take vaccination.