Density isn't really the problem in San Francisco. The problem is available housing. Relatively speaking San Francisco is far less dense than many other cities. But these other cities don't have housing shortages.
Well, I didn't bring density up - I was just responding to the Berlin vs. SF comparison on density. But I do think that available building space can ease a lot of the discussions. Having to tear down low density (and possibly quality) housing, build in somebody's backyard, cover up small specks of green, et al. allows for far much more backlash/nimby than if there's copious unused/undeveloped land.