There’s an old saying that locks help keep honest people honest, but nothing stops your really dedicated thief. A wall is the same thing. It absolutely will not STOP illegals and drug smuggling and the like. But done right (always a tough nut with the government) it will increase the level of dedication needed and that will reduce these problems.
Build a double fence, and populate the intervening area with cougar and wolves...