The military is a job, true. But not just another job. The military does not only demand talent and skills in exchange for compensation. It also requires that you give up your life if need be for Queen and country; not some billionaire who sells vacuum cleaners or flies a fleet of 747s and Airbuses.
Compensation must always be just. The Spanish Tercio; the French Foreign Legion; even the US military -- they all recognise the foreign recruit's extra contribution to the country and so give them automatic residency and eventually, citizenship, in recognition. Not Britain, though.
Foreign recruits and NHS staff are not just "everyone".
We have got enough foreigners already and far to many using the NHS. The last thing we need is more thank you very much !!