Real estate prices so high that “listings read like typos” and dwindling diversity are disintegrating America’s once alluring City by the Bay.