The problem with building up on the coast of CA is the faults. Where Tesla is located, the Hayward runs nearby, and it's way overdue for a major quake - when it happens, Tesla is going to be in a world of hurt (along with the rest of the East Bay). East of the hills, there's the Calaveras fault, which has been a little odd lately, with lots of little quakes. So going up is way hard, as it subjects a lot of people to unacceptable levels of risk.
But there's up and there's up - a lot of the new condo complexes being built in NE San Jose/Milpitas/Fremont/Union City/Hayward are 4 or 5 story balloon frame buildings which are designed to withstand at least some degree of earthquake. Those are not my favorite sort of place if they're not built well (they're noisy) but otoh they have city-style density. The trick is to adjust zoning so that there is commercial on the ground floor and residential above, just like the rest of the world's cities....