When I was looking at SF real estate I was surprised to discover nearly half the housing market was built on landfill. And surprisingly few of those buildings are built on bedrock.
I was going to make a joke about San Francisco culture, but honestly this kind of thinking happens everywhere. Look at all the people buying or building in areas with flood potential that is high and increasing.
I believe there's a neighborhood in Houston that was build on land specifically left undeveloped in the past because it floods every time there's a hurricane.
Where there's enough money to be made, you'll find shady business people and corrupt politicians willing to risk people's lives and livelihoods for a buck.
Plus, the federal government will keep giving people enough money to rebuild on flood plains, so it makes financial sense to keep building in places that keep getting washed away.
There's documentaries on the post 1906 earthquake rebuild where they were going to build to be earthquake safe but as time went on and demand increased that got thrown out the window.
Though at some point I think code enforcement returned, especially for large buildings.
The most at-risk buildings in SF are so-called "soft story" buildings, low-rise multifamily dwellings built on top of a parking garage or commercial space, especially those constructed
before increased regulation (I believe in the 70s or 80s): https://en.m.wikipedia.org/wiki/Soft_story_building
I used to live in the former garage of a soft story building (they built a kitchen/bathroom/etc - it was around 1,000 square feet). It was a great deal because we got sole access to the backyard (it was a house). But after reading about how they relaxed building standards after '06 rather than increased them, I couldn't wait to get out - the house was built in 1918.
The landlady would always talk about how the house held up great during the '89 earthquake. But that didn't impress me considering the epicenter was in Santa Cruz.