It's important to note that this isn't some worldwide, universal practice. Many countries, such as the UK, do not have vaccine mandates to enter their school system. There are also different rules in different U.S. states. It's also quite unfair to compare vaccines that have 1-3 doses to essentially vaccinate children for a lifetime against horrible and deadly diseases to a vaccine that needs endless boosters for a disease which presents very little risk for children or immune adults. My child isn't required to get an annual flu shot to go to school and I don't see how this is much different.
So I agree it is contextual and I think this is the proper context.