Just because your tastes are different, it doesn't mean most other people agree with you. For some it does make rational sense to stay, and for others rationality isn't the driving force, and there's nothing wrong with that.
(Though I guess you said "SFO". I wouldn't want to live in that airport either.)
Name another major city where you can get amazing food, have a bonfire on the beach with your dog, and enjoy views of the ocean and bridges like you can here. Its really the most European of the US cities.
It is expensive. It is dirty and dingy in places. It does have a homelessness problem (what major city doesn't?). It is all these things and still one of the most desirable places to live in the US. It must have a lot to offer to outweigh all those cons - and does.