Can you really keep out tens of millions of people with a wall? Absolutely, if you're willing to enforce it. You may have to kill some of those people to do so, though. Which puts us right back at your second paragraph.
Europe and the US kept hundreds of thousands of Jewish refugees out of their countries during the Holocaust. We certainly can do it again, with just as shameful results.
Not to mention the moral issues surrounding letting tens of millions suffer and die because we don't want to help people.
Can you really keep out tens of millions of people with a wall?