Based on what I know, people are flocking to cities because they want to be there, and companies are locating there in order to be attractive to employees. Cities have very high levels of services (due to economy of scale and density), restaurants, the arts, sports, walkability, bikeability, energy, community ... sustainability ...
San Francisco has all that in one of the most beautiful cities in the world. Many people prefer that.