They did the best for society, not for their child. Yes, vaccines are the best choice, there is no doubt about that. But the society in question must take much better care of those who sacrifice so much for the whole.
Herd immunity arguments can make that calculation more fuzzy but the herd can't tolerate many people opting out and still give group cover. So after a certain amount of people, choosing not to vaccinate is seriously risking illness. Society is built to handle those types of collective action problems. The moral case is still clear IMO.