Cheap foreign labor flocks to Singapore because it's much richer than the countries around it. But that's not how it got rich in the first place. Singapore had a restrictive policy on foreign workers until the 1980s. But by that point its GDP per capita was already almost as high as the UK's: https://emergenteconomics.com/2012/03/12/718/
And insofar as Singapore has such a policy now, the rest of the world should take notes. Creating wealth from poverty within a few generations is miraculous, and the system that achieved that should be emulated.