I think even sans the tech industry, SF would still be a desirable enough place for people to live that it wouldn't have much of a problem. Even clearer if tech just remained in Silicon Valley; plenty of people would live in SF and commute.
Even just finance is probably strong enough to support SF. Or, like Vancouver, lots of people from Asia. The tolerant/hippie/gay/etc. angle might be enough as well.
SF in '89, before tech started hitting, was not a pretty place. The Dirty Harry movies of the 70s, I think, were inspired to some extent by the decaying city. Technology breathed life into the Bay Area (San Jose was not much better back then either).
You have to understand that nearly all cities were shitholes in 1989 until the Urban Revitalization of the late 90s. This wasn't an SF specific thing. NYC, for example, had over 1200 murders in 1992 (!!!) compared to last year's 414.
SF's revitalization has more to do with that than with "tech" jobs. I know in the Hacker News echo-chamber its hard to think there's anything but Internet Tech in SF but it's got ALOT more business than that -- It's the largest banking center on the west coast, got a massive bio-tech footprint, has some major apparel companies (Levi and Gap and a bunch of smaller ones), etc, etc. It's pretty diversified.
What caused the "urban revitalization"? Was it just that people who hadn't been around during the 1968-~1980 urban hell were finally in a position to be buying their first homes?
Honestly, I don't know so I'm going to speculate based on experiences. I think it's a generational thing. The younger generations seem to want density, to be around things, to not own a car. I think growing up in large suburban homes, there's been a genuine desire by younger people to move to cities and away from that lifestyle.
You can see this happen in many ways aside from city's becoming safer: Real estate cost increases in cities, The whole bike-movement is an element of it, NYU getting 44k applications, the growth of the Brooklyn "brand".
I think, generally, there's a real desire for an urban community with culture and shared experiences. I know I don't have anything more 'concrete' to back this up, but this is the general sentiment of my friends (in their late 20s to early 30s.)
Even just finance is probably strong enough to support SF. Or, like Vancouver, lots of people from Asia. The tolerant/hippie/gay/etc. angle might be enough as well.