We literally vaccinate people against diseases they might never personally catch because preventing transmission is part of the goal
And there's the mistake in your understanding. The personal benefit rationale is that they might catch it if they aren't treated. The public health benefit is a reason a government might promote this, but the reason medics will recommend it is personal benefit.