Look, I object to the idea that the host country is responsible for the spread of diseases that are brought by immigrants, which is what you're implying when you blame the spread of diseases on the lack of affordable healthcare. I didn't know this was controversial.
It's totally normal for countries to screen for this stuff both at border entry and as part of the immigration process. In Australia we check at the border if you're coming from a country where they have certain diseases (e.g. yellow fever). If you're applying for some immigration status you need medical checks if you're from certain countries to screen you for certain conditions (e.g. tuberculosis).
It is absolutely the host country's responsibility to do this to keep their own citizens safe.