The very idea of a foreign worker comes from the mind of a person who thinks that he (or she) inherits the land that he resides and therefore all else who come into that space is an intruder, and hence foreign to it.
This idea originated from olden gated communities called cities, the residents of the cities being citizens who had the sole right of governing their respective cities. The floating mass of "other" people including slaves and indentured workers and even merchants and traders were left to their own devices, with the right to do anything but any say in the government.This idea continues to today.
The population of the foreigners can swell to a size that makes their presence highly visible. The challenge for the government is to impose strict laws so that order can be firmly established. But visibility gives the so-called foreigners the power to act, so long as they can fight a good reason to do so. A good reason is anything to do with right and justice.
The invitation of a population of foreign workers to any country is initially for the selfish reason of profit - that the foreign workers can be paid cheaper than locals, supplemented by food and accommodation which can be kept cheap with basic staples and temporary shelters. It is only when the foreign workers need to engage in their very human need to socialise that they try to have contact with the local population, and this opens a whole new can of social issues.
At the end of the day, the very problem is the idea that foreigners can be kept temporarily on a sustained basis of servitude to the local gentry and citizenry. It is an extremely primitive and crude view. By the law of dialectics, power becomes to those who work. The master
commands the slave to do everything for him, such that in the end, the
master depends on the slave for his well-being. So, one really cannot have the cake and eat it.
People from other places are also human beings, and they have come here to work very hard to survive and to built their own future. They are not a transient float. They will be here for years and decades. Their presence must be properly recognised so that proper work of a normal government can be extended to them - health checks and healthcare, sanitation, nutrition, housing, education of their children, social activities and their general well-being so that there will be no tendency to demonstrate loudly and violently their problems; or worse still, their desire to do their "revenge" on the country.
For this, country would need to take an enlightened view on foreign workers to convert them into immigrants and better still citizens who can be encourage to help contribute to the national interest in all ways, including governing the nation. This is a long call, but it sets the direction of where the idea of using foreign workers to enhance the national good will take, if taken to its logical conclusion. The use of foreign workers in many countries now is no more a temporary issue, but a long-term structural problem which can only be resolved with a properly constructed policy of assimilation of people into the local communities. This is what proper policy making is all about - and here we are talking only about foreign workers.