The relationship between border towns is very tight. You would ruin the entire southern economy if you banned cross-border travel entirely.
Back in the day before Mexico required passports to enter, many people lived in Tijuana and worked in San Diego. I'm sure this still happens today, and of course, you have to consider that many migrants work in US farms, etc.
San Ysidro is still the busiest border crossing in the world. It's nominally 'closed', but still open for trade. In normal times you don't need a full passport, either- just a passport card is fine, and realistically a CA driver's license will get you through without trouble. It kind of has to be that way- Tijuana and San Diego are far too closely tied together for much else.
Border closures don't have to be all or nothing. In Australia we closed borders between states but allowed work permits in some places and had fuzzy borders (people within 100km could cross) in others.
Back in the day before Mexico required passports to enter, many people lived in Tijuana and worked in San Diego. I'm sure this still happens today, and of course, you have to consider that many migrants work in US farms, etc.