Secondly, you don't just build apartments and you're done - a density increase requires more services to handle those new people. That's supermarkets, restaurants, hospitals, police, etc. All of that needs to be built up as well and usually isn't considered. If you DON'T add any of that, all you have done is reduce the services available for everyone in that area. What's the advantage of this again?
Finally, comparing the density of SF to Manhattan is not remotely accurate. Manhattan is the highest density part of NYC. SF contains a number of huge parks, mountainous areas like Twin Peaks, deeply residential areas like St. Francis Wood, etc. If you compare the density of the Mission vs. Greenwich Village or something like that, I could see it being relevant, but SF vs Manhattan is apples to oranges.