The best way to stem the flow of desperate immigrants to the US is to eliminate the violence in Central America. With the corruption of the governments and the prevalence of drug trade, it looks like colonization is the best options. Instead of deploying 150,000 troops to the Middle East, deploy them to Central America. Mexico is a borderline country where the government may have enough stability and legitimacy to work with the US and the US military. The rest - not so much. We will need to invade the countries, replace the governments with US appointed governors, and march across the land destroying anything that looks drug or gang related.
If people approach the line with hands up, they will be allowed to pass through. They will be allowed to explain their situation and any property they provide a legitimate claim to will be searched. If it is clean, it will be marked and returned. It will be subsequently monitored. Gang members who surrender peacefully will be reviewed and dealt with as their circumstances warrant. If they were forcibly conscripted, show a genuine fear and remorse, and aren't tied to any murders, maybe they can be monitored and relocated. If they resist or are one of the leaders, they'll be killed - of maybe tried and dealt with accordingly.
If the US military action is conducted professionally and with extreme regard for keeping people alive, the population may not be too upset. The subsequent occupation will have to be very concerned about raising the next few generations to understand the value of competent governments and be ready to assume those roles. In the opposite of old-world colonization, the spoils of the country will need to be returned to the country with more added by the US. We need to give them an education system so the population can develop the skills to run a successful government and economy. It must be tailored to fit within their history, traditions, and customs even if some of it may be embarrassing to the US and Europe. Only when they have a safe and stable country and economy will they stop fleeing to the US.