"Perhaps they should contribute and pay something, like taxpayers have to."
Many of them are taxpayers. This isn't targetted at tourists or illegal immigrants.
FWIW, here's the BBC summary of who currently gets what:
• Free NHS care is offered to anyone living in the UK who has temporary or permanent permission to do so
• Asylum seekers, non-European Economic Area nationals who do not have permission to live in the UK, British expats, and visitors usually have to pay for treatment
• The UK has reciprocal agreements with most European nations and 28 other countries, and under these visitors are given free NHS care
• The NHS should claim these costs back from the relevant governments - but research suggests just £73m a year is recouped out of more than £460m at present.
So if they really wanted to save money, they could work harder at recouping the reciprocal costs at national level - without getting into hugely expensive policing and legal costs around individuals.