If we want housing to be an investment, we have to acknowledge it's going to rise in value faster than inflation (otherwise it's a crap investment), which means it won't be affordable.
Conversely, if we want housing to be affordable, it cannot rise in value faster than inflation, which means it can't be a good investment.
As Charles Marohn says, it's not even a "problem", in that problems have solutions. It's a predicament.