jobs. You can be a half-assed engineer here and be employed; if you're good, you have dozens of choices of place to work. Whenever I ponder leaving (and I'm a data scientist, so more specialized) I look around at cities like Salt Lake or Denver or other places close to good skiing and see like 3 employers. Total. What happens if I don't like my job / my boss changes / whatever? I'd probably have to move. It's just a ton of risk for the employee.
And not just jobs, but other people who do the same thing that you can learn from. And full stack: from the people building javascript libs to new programming languages (swift, rust) to chips (Apple, Intel, hardware startups), etc.
Proximity to the outdoors. If you want great surfing, hiking, skiing (well, ex the drought years), climbing, camping, etc -- it's here. And the state is dry, so no mosquitos or flies. ie it's much more enjoyable to be outside than in the midwest. It's fun to be outside 340+ days/year.
Non-competes are invalid by state law. And this isn't a theoretical problem; I had a job offer withdrawn in NY because the new employer's counsel determined they were covered by then-current employers non-compete contract and they didn't want the hassle.
People who view quitting their jobs and starting companies as merely modestly crazy/risky, instead of something only a lunatic would do.
Oh, and as for your average rents: yes. You can get cheaper rents, but at the price of shitty public transport, a terrible commute, and a lack of local services where you live. Which is particularly punishing if you don't own a car. sf as a city is run by worthless idiots who decided to play city, so big pieces of it have terrible (unreliable, slow, unsafe, etc) public transport (yet it manages to be some of the most expensive transit in the nation as the cherry on top). Plus there are 3 public transport systems that essentially were built independently and operate without any coordination, two of which only serve pieces of the city (muni, bart, caltrain). And until the age of uber a taxi system that specialized in shitting on their customers. Because where, besides sf, would a taxi that actually comes be worth paying a 50% premium ala uber when it debuted? So yeah, wildly incompetent city government.