Walls work.
It's that simple.
They are passive barriers -- the greater the barrier, the more effective it is.
I saw this first-hand in West and in East Berlin in the spring of 1971. The Berlin wall was one of the best-designed "people barriers" ever built, using not only walls, but watchtowers with motorized patrols between the walls.
Yes, some people got "through it" -- but those who did were a mere drop in the ocean vis-a-vis those who were detained from doing so.
All the more impressive as it was designed to keep people -in-.
In its time, the Berlin wall served as a working example of how to control migration.
You may dislike the reason for its construction, but there's no denying its efficacy.