I can't think of one nation that doesn't in some way do these things. Immigration has always been subject to the will of the nation. It was never an open door all the time and the US was more or less selective throughout history, and selective with specificity at times. Sometimes, a nation just has to shut its borders and fix itself. Several times in my life I felt that way about this nation.
Nothing wrong with defending the borders against a malicious attack. But the current issue is one of people fleeing oppression, poverty, and sometimes death. Big difference.