In many ways, it was WW2 that sealed SF’s doom.
SF was the primary intake center for draftees in the western divide of the country (I don’t recall if it was everything west of the Mississippi or the Rockies?)
Anyway, many of the dysfunctional and depraved that failed their draft screening generally decided to settle in SF rather than return home and face the shame of friends and family.
So, basically, the weak, psychologically/mentally unfit, communist and homosexuals of a large portion of our country was condensed into San Francisco.
Interesting theory and it's the first time I've heard that. I really have a hard time believing that to be a root cause, though. I just did a quick search for data on the number of inductees who failed fitness exams in WW II and couldn't find anything.
The great weather is probably a much bigger factor. It's just so much easier to be a bum in an area with a good climate and lots of prosperity.
Then the Great Society made it easy to get paid for not working and the states then out-competed to offer the most homeless benefits.