There are two parts of the immigration problem. One is that it is very easy to enter the US illegally. The enticements of jobs, money, and opportunity make it very hard to combat illegal immigration.
The other half of the problem is that countries illegal immigrants leave are so bad that no one wants to stay. If they want to enter the US and leave Mexico, how can you stop them. There have been a few improvements in making it harder to enter the US, but that doesn't make anyone want to stay in their homeland. If Mexico had a free and open society and opportunities for jobs and prosperity, there would not be this huge flood of people leaving.
I think the US should encourage economic reform for societies who have people who want to come here. There should be standards of overcoming corruption, putting the dealings of government in the daylight, and cultivating opportunities to take advantage of the vast natural and human resources of these countries. These countries could be given more freedom to enter the US as they become more prosperous.
To make it hard to enter the US will help, but to give them a reason to stay home will do far more.
Also, the US can set the example in shedding daylight on government and overcoming corruption. If this was the policy of the US, many problems would be solved across the hemisphere.