Anything that is meant to be consumed should not be an investment, anything that in an ideal society should be cheaper to purchase for the betterment of that society, should not be an investment.
Companies that produce those things, ideally better or more efficient every year for various reasons, those should be investments.
We should invest in banana farmers, not bananas. Likewise we should invest in construction companies, not houses.
Which is a silly conclusion... What's the point? The better question would be why isn't more housing being built? And I suspect the answer to that question is there is a vested interest in increasing that deficit.
Whenever someone starts to conclude that housing is so expensive purely because there aren't enough homes, they often follow that up with pointing to construction costs. Which to me screams deregulation and wage complaints, two things an improving society should not be encouraging.