But one of these is the market functioning correctly - people moving to places with good jobs. The other is the market being manipulated to serve the interests of a relatively small group of people - restricting housing supply.
No, the market is not functioning correctly. The SF housing situation is making it increasingly expensive to get workers in SF. In a functioning market this would cause businesses to set up elsewhere. This isn't happening, in part because funding is coming from a relatively small, tightly-connected group of SF-centric VCs.