If it were done correctly, and it has nothingn to do with fences and walls.
Illegal immigrants come here to work, and if that work goes away, they'll stop coming. The key is to punish, harshly, the businesses that hire illegal immigrants in order to save money.
Right now, there is no real incentive for businesses that hire illegal immigrants to stop doing so. They know that detection and enforcement is spotty, at best, and the penalties are so small that they are seen as a cost of doing business. In other words, even if a business is caught hiring illegal workers, the penalty is still much less than the cost of hiring legal workers would have been. Their profit stays up, even when caught.
My plan is pretty simple - make it financially devastating to be caught hiring illegal workers.
1) Implement a reliable verification system so that employers can verify whether or not an applicant is legally eligible to work in the U.S.
2) When an employer is caught using illegal workers, impose a two-pronged penalty. One prong is to reimburse the worker - five years or actual years worked, whichever is higher, of wages at twice the minimum wage, paid directly to the worker. The worker should still have to return to his or her country, but will leave with a hefty amount of cash to help fund the application process to return to the U.S. legally. The second prong is to impose the same amount above as a fine, payable to the U.S government which would be used to aid in enforcement and pre-fund unemployment accounts for use during economic downturns.
3) Forfeiture, for five years, of ability to obtain any government contracts.
Until employers feel the pain of hiring illegal workers, they will continue to do so, and all of the walls and fences in the world won't keep people out.