From my limited understanding, I take that this is the issue in SF. There is a lot of regulation issues with building denser housing thus the shortage in supply.
Your understanding is certainly limited. Housing prices all over the Bay Area have increased similarly. SF is not an outlier in terms of percentage appreciation compared to nearby cities.