Actually it really does not work that way. Yes, you stop the people that just walk over but criminal organization have no problems getting into the US, they never have because as long as the system is controlled by people, money will make a way.
It actually does work that.
Drugs and other illegal items don't simply walk themselves over a border, they require people... On both sides.
Will you ever completely stop either? Absolutely not. But you can reduce it to a point where it's an inconsequential issue.
If Australia still has illegal people crossing dangerous oceans in rickity old, un-seaworthy boats... And there is a death toll to it.
Then the USA sharing a land border with it's southern neighbor will have an infinitely bigger task securing that border.
What exactly make you think that drug cartels just walk their merchandise over the boarder. No, they drive and ship it over just like they always have. You really believe some mule is bringing over the boarder and smuggling illegally all the drugs to the US on the back of some illegal immigrant. That type of illegal drugs is a drop of sand compared to what gets sent here legally. Lets not kid ourselves in believing that the amount of illegal immigrants coming illegally by building a tunnel or climbing a ladder is the main entry point of drugs in the US. Drugs cartel have not relied on that method for decades.