Usually, if a kid has a health concern which they weren’t vaccinated against in their formative years, they can transmit it to others. However, they are often curable.
It becomes a problem if in the latter years, children contact a disease that has no cure yet but could be prevented by a certain vacinne. Surely, others will be affected and that's the reason strict laws should be made in cases of exception.