They’re not necessarily at odds. Manhattan has something like 75x the population density per mile. You could rewild 4/5 of the the SF Bay Area while also building 10x the housing stock under that development pattern. Single family homes are just an extremely expensive and ecologically destructive way to live. They require a ton of infrastructure per person.
Unfortunately, I think that housing unaffordability is just a desired feature - people who live there don’t want to live near people who couldn’t afford to live there. It’s much more segregated than many other parts of the country I’ve lived in.