It's not just building enough homes. The cost of building has gone up a ton as well.
The median age of a home in the US is 37 years, which means 50% of homes were built before 1985. Compare building codes from before 1985 and 2022 and it's a huge difference. Now housing codes are there for our safety, but we also need to recognize that it makes homes much more expensive and complex all while 50% of people are living in homes built under "less safe" code standards and are just fine.
I myself live in a home built in 1967. It's a lovely home and just as livable as a home built today. Only a few select projects were needed to improve safety in places that mattered like replacing the electrical panel and some modifications to my deck.
When going through insurance pricing in the case of catastrophe (fire/earthquake/landslide) with my insurer, they estimated that the cost to rebuild my home today to modern standards is equal to our purchase price for the home and the land, which is crazy and gets even crazier when you consider that the cost of the land is about 2/3 of the value of my property.
Furthermore, the more labor and complexity that goes into building a home, the more homebuilders focus on upscale homes instead of mass market homes because of opportunity cost, especially when the permitting process is also so onerous. The only cheaply built housing options these days are apartments and condos. 40+ years ago we were building full single family homes for the cost of building an apartment today. That's insane.