In a recent seminar at the World Bank, Peter Dixon and Maureen Rimmer presented a paper titled "Illegal Immigration: restrict or liberalize?" showing that tighter border security and internal enforcement actually reduce the welfare for U.S. households; raise the wage rate of the undocumented migrants who remain; and generate dead-weight losses in the form of prosecution and prosecution-mitigating activities. More importantly, they explain that restricting the inflow of undocumented immigrants pushes U.S. workers towards low-paid, low-skilled jobs.
On the other hand, legalization produces a strong welfare gain for U.S. households since the supply of immigrants (now guest workers) increases and their wage falls. At the same time, the additional inflow of guest workers has a favorable effect on the occupational mix and average real wage rate of U.S. native workers, allowing native-born US residents to complete their education, enhance their skills, and move up the occupational ladder.
The paper surmizes that legalization is good for America since it will eliminate smugglers fees and other costs related to illegal entry, and allow immigrants (the former undocumented immigrants) to be even more productive. If we accept this model, this means that the best action for countries with large undocumented immigrants is to legalize them and to develop a comprehensive temporary worker program.