Radiolab (the podcast) did a good series on border policy that was pretty informative.

IIRC, the US-Mexico border was never open, but it was quite porous. People would come to the US, work for a season to make some money, then go home.

Then once border security started to be tightened, leaving was too risky so people would stay leading to a huge increase in the number of undocumented people living in the US.