SF was always dense. At some point, all these tech companies moved in, and it became what I call a "commuter city" where a huge proportion of people there during the day don't actually live there or necessarily want to be there. It also shifted the culture, probably for the worse. Of course many living there beforehand might not like that. Yeah some people own property, but generally big business stands to gain the most from the influx, not the residents. I wouldn't be happy in their shoes either, and the only reason I wouldn't be NIMBY about it is I'd just leave. The NIMBYs basically lost; the city grew anyway.
And it comes from every side, not just a "left or right" thing. People with nice houses don't want their neighborhoods to deteriorate. Renters don't want rent to go up. Even the stereotypical SJW people against gentrification... that's NIMBY.
Also, being a dense, very wealthy area with relatively fair weather, SF is naturally a place for homeless people to congregate. Besides the obvious squalor that brings, businesses don't trust just anyone off the street. No public restrooms, no chairs in Starbucks, covers on everything in Walgreens, ID requirements to enter stuff, you get the idea. There's no obvious solution to that.