Matthew Yglesias makes a smart point:
People should remember that not only are wage levels higher in the United States, the price level is higher too. Consequently, the best way for Mexicans willing to migrate to maximize their real wealth is to come to the US to work and then take their money back to Mexico. Temporary labor migration of this kind has traditionally been the goal of most work-oriented border crossing and the easiest way to prevent it from turning into illegal labor and semi-permanent settlement is to create a legal channel.
The other effect of increased border security is that it interrupts the cycle of migration, marooning people here who might otherwise return home for this very reason. But because crossing the border is so dangerous, once here, people tend not to go home even if that's what they'd prefer to do. According to a 2003 study on Mexican immigration to the U.S., “The end result of a border buildup is typically longer trip durations, lower probabilities of return migration, and a shift toward permanent settlement.” Border security doesn't work very well at keeping people out, but it can keep people in. The irony is that border-centric policies, ostensibly meant to reduce the population of unauthorized immigrants, can actually make it larger.