Not sure exactly what you mean by highly valued, but as far as valued from the drug/pot user standpoint, San Francisco was the birthplace of the counter-culture movement back in the 60's and has continued on that path ever since.

If you are referring to the literal "value", as in home prices, mainly due to being in California as most property there is higher priced and again also due to the history of San Fran.