A child can be immunized against measles by a vaccine. The vaccine is safe.
People who deny the safety and efficacy of the vaccine, and thus fail to have their children immunized tend to cluster in the same communities.
If one child in such a community comes down with measles, it is much more likely that that child will infect others than if a child in a community with high levels of protection gets the measles.
I think children deserve protection against bad decisions by their parents, but they especially deserve protection against bad decisions by others (such as the parents of other children in their schools or churches).