In some sense, that duality is true of any functioning city, isn't it? They fundamentally manifest a concentration of capital. But, they also host concentrations of young, working populations who can bring progressive culture in waves.
San Francisco has been such a concentration point and crossroads since the Gold Rush era. It had a frontier spirit, but also became a west coast center of finance and logistics. It has always been an arena for this tension between opportunism and idealism.
caveat to my above comment, I do think there is a crowd that comes to SF due to proximity to capital. There is also a contingent of longtime residents, who may or may not work in tech and may not espouse the value of the executives they work for.