Some people are poor. They'll risk everything to come to the US or other wealthy countries. That's the economic reality.
You have several options:
* Become like North Korea. Walls, "papers, please", etc...
* Ignore it and pretend like you can keep them out or that there's a viable "legal path". This is kind of what we're doing now.
* Make it easier for them to come legally so that you can keep track of who is here, kick out the people who actually misbehave, and otherwise run a lawful and orderly country.
This has some parallels with the "war on drugs".