Housing should have never been considered an investment. It is a basic need. If that basic need becomes an investment, it is by definition going to become less affordable to those who do not hold it in the future.
If you consider it an investment, homeowners are going to protect its value like one, and prevent supply competition via regulations, voting power, etc.
It is a strange world we live in where we collectively believe that a basic need should appreciate in value over time.