Part of the problem with respect to applying this to vaccinations is that vaccines have a low but non-zero chance of failure.
If everyone gets vaccinated, and 1% fail (that's just an arbitrary number), it's no big deal because there isn't enough of a population to carry an outbreak.
But if 1% of vaccinated patients are vulnerable, and 5% of people choose not to get vaccinated, then now there's a potential for outbreak, and even some people who vaccinated get sick.
In economic terms, by not vaccinating you're introducing a negative externality into society that you're not paying for, so the true cost to non-vaccinators is artificially low.