This is so absurd, I left SF last month and I still can't fathom why anyone would spend that much money to get a house there. I guess if you are stuck there because of work, and work pays really well? But I can't see any other reason why you would pay that much money for a place that is not that nice.
It is less logical, but when you see all your peers here spend that kind of money for houses, you start to question less. Also, it is a market, which is controlled by supply and demand dynamics.
... which, of course, include rampant speculation and wild assumptions about return on investment based on past history that may or may not reflect future performance.