I was of the impression that, in the US at least, such immigrants might be allowed to purchase Medicare if they’d been here for a long time and worked/paid payroll taxes for many years—but that they certainly wouldn’t qualify to get it for free in the way native-born people do. Native-born people with 10 years of formal employment, anyway.
Not sure how that works with Medicaid—it sounds like [1] some states have chosen to implement that in ways immigrants can access if they come in on green cards and spend their working lives in the US, paying in to the system—but that seems to me more like a local policy choice than a primary feature of the immigration system.
For that matter, in your formulation, should the working-age immigrants themselves, who permanently resettle and work their whole life in the US, be denied access to old-age benefits when the time comes?
[0] https://www.kff.org/faqs/medicare-open-enrollment-faqs/enrol...
[1] [PDF] https://www.health.ny.gov/health_care/medicaid/publications/...