If vaccines really work to protect an individual against a pathogen, why does it matter if other people get vaccinated as well? This is a concept known as community, or herd, immunity.
Not everyone can get vaccinated; sometimes vaccinations are only given to children above a certain age, sometimes people are allergic to an ingredient in the vaccination (some people allergic to eggs cannot take certain vaccines because they use the egg protein to suspend the pathogen), and other times the vaccine just didn’t work as effectively as it was supposed to, because nothing is perfect. For those people, it vastly minimizes the risk that they get the disease if everyone else is vaccinated, because it decreases the spreading. It is much harder for the pathogen to move from person to person if it keeps getting eradicated in vaccinated individuals.
This is why the anti-vaccination movement can be so dangerous. Due to the spread of this movement, rates of vaccinations are decreasing, leaving a lot of the population susceptible to diseases, including those people who would get vaccinated if they could, but due to individual reasons cannot. It also causes a lot of diseases that had been previously almost eradicated to begin spreading again. Therefore, the argument that it is an individual’s choice to get vaccinated does not make as much sense in this case because even an individual choice does negatively affect other people.