SS tax, and Medicare tax, are income taxes, not dissimilar to your federal, state and local income taxes. As you likely are aware with regard to the latter, we pay them when we have INCOME. Even if we are using or not using the projects and programs they are intended to cover, it is irrelevant, we pay income tax on income. Even if we don't drive, we pay those income taxes to keep our roadways in order.
SS is similar, except we don't pay that tax on ALL income, but only that from working. So we don't have to pay it on investment income, prizes, inheritances, etc. However, given that it is an income tax, so long as you have income from the source it specifies (work income), just like other income taxes, it doesn't stop being due simply because we are collecting SS insurance benefits. You can look at it like this as well: when we pay premiums on health insurance and then actually draw those health insurance benefits, our carrier does not say, OK, you no longer have to pay your premiums for your coverage but we will still pay you your benefits, your hospitalization, doctor visits, prescriptions, etc. No, our obligation to pay those health premiums continues, as that is what is required to keep the policy in force. (SS is different in other ways, but that is simply an example of a similarity.)
Medicare is health insurance. Once we hit 65, we can use it, are covered, IF we continue to pay our medicare health insurance premiums - because if we don't pay the premiums, that coverage also will end. The government, like an employer, pays are large part of our premiums once we are 65 (out of those Medicare taxes we paid AND our neighbors are still paying if they are working, and we are paying if we are still working), then we also pay a CURRENT contribution to our own premium (i.e. the $104.9/mo for Part B) - again, not so different from the employer provided insurance, which usually pays part of our CURRENT premium, while having us pay part also. And, aside from current premiums, there is a medicare tax on our income (even on those not able to use Medicare, must pay it), which helps, presumably, maintain a fund for the future payment made by government for its share of the Medicare premiums that future retirees will need to have covered.