In addition to people for whom the vaccine doesn't work, there are certain groups, like those with compromised immune systems, and infants, that rely on herd immunity. There's also the disruption from mass absences if an outbreak does happen. The teacher has to spend time to reteach things because of absences, to the detriment of everyone involved.