Rav Moshe Heinemann explains in his sefer on Medical Ethics (1:4)
The main issue with getting vaccinated which we need to consider is
not so much the question for yourself – if you don’t mind getting the
disease, then that’s your choice. You have a right to make that
choice. However, the main question is spreading the disease to someone
else who ...