When staying where you're at means certain death for you and everyone you love, going somewhere else where the law just wants to make things difficult isn't a hard sell.
I mean, we could help alleviate the problem by not backing strongman dictators who terrorize their people so that we can get cheaper resources, but that would make an executive somewhere slightly less rich. Shouldn't foreigners want to see their families die rather than have that happen?
Refugees die trying to cross borders all the time. That doesn't stop them from trying.
You're missing the point. Make it less enticing to come here, then a lot more of them are going to not want to come here. Make it near impossible for illegals to get jobs here. Make it so they can't legally live anywhere. Make it so there's no programs to support illegals so that they can't get any money to send back and risk starving to death. In short, make it so being in America illegally is as problematic as possible.
Then, make it so that coming here perfectly legally is both quick and easy and all the aforementioned issues are not a problem for legal immigrants. Now we're got a massive immigrant population that actually contributes to the country and pays taxes. BOOM! The problem of illegal immigrants is solved.
It's really extremely simple and very very obvious how to solve the problem. Plus it would take a fraction of the time, money, and effort it would take for a useless wall. Even if it wouldn't solve it completely it would still massively curtail the issue of illegal immigrants. The reason nobody does exactly this is because of the political suicide of "they're letting ILLEGAL IN!? They're gonna take DUR JERBS!!" Even though that wouldn't actually be an issue if this was implemented correctly.
The reason immigrants in general come to the United States is because they want a better life. The reason illegal immigrants come here is they get that even though they are illegal and thus should be getting punished for coming here rather than rewarded.