But that has no beneficial effect unless you limit access to those residences to people who work there (including evicting them upon job change) and limit jobs to those who live locally. Neither is legal.
This ends up not being a problem in practice as long as you just simply have enough housing.
Well you need both. Where people work in the SF Bay is distributed heavily through the area. You'll always have commuters, especially in two income households