I think the immigration process mostly works fine.
There's a thing in business called shrinkage. In short, it's the amount of loss that a business expects from theft or waste that they just can't prevent. They don't want any loss from theft but they accept that it's going to happen.
As I write this post, I'm not aware of the exact number of people who enter the country illegally or enter legally and then overstay their visas. If the number isn't that high, you just write it off as shrinkage. If it's too high then you put more money in deportation efforts.
Nothing against the border but that's a point of diminishing returns. No matter what you do, once you have a system, highly motivated parties will find a way to circumvent your system. You want to do enough to dissuade simple rule breakers.
However, you're always going to be playing catch up with the highly sophisticated rule breakers. Chasing them means spending money to close off strategies after they've already been exploited. The first time someone finds their way around your border system, you won't know. You won't know until the exploit becomes significant...at which point, all of the illegals have already entered the nation. So, enforce the border but you have to accept some shrinkage.