Breastfeeding is usually preferable but it is a drain on the mother, can be painful, disruptive, not an option depending on the culture, only an option for one parent, sometimes not even then.

Vaccines and breastfeeding are not comparable things.