Anna, first, vaccines are not 100% effective so, even if someone is vaccinated there is still a risk that they will catch the disease in question.  Then there are those who cannot be immunized for whatever reason (too young, compromised immune systems, and so forth).