Does that make any difference ethically?
In the HPV case you are weighing risk to the boy against potential harm to a vague ill-defined community. He's only endangering his sister or mother by perhaps slightly raising the level in the general population and so slight increasing the chances someone unrelated to him they have sex with will give it to them.
In the COVID case you are weighing risk to the child against risk of harm to the rest of the child's immediate family. Losing immediate family can be pretty harmful to a child, perhaps enough to ethically justify taking some risk to the child to avoid it.