Of course they *can* be, you could easily cite an example on each side eg: a home which rents for $100,000/mth, but sells for $250k. Or, some rental markets may dictate you receive less than the interest alone on your mortgage, let alone other taxes/fees/repairs or even thinking about building equity by having "someone else pay your mortgage". Cash flow negative and getting worse. While these are extremes, it should be at least proof that an equality point lay in between.
Housing as an investment, is one of the most difficult ones to evaluate. So give it to people who are piss-poor at evaluating easy investments(ie 80% of public + mass media) and you have no hope. Basically you have to sum and compare: compounding/time discounting with potentially variable rates, dividends/cap gains of market investments, expected cap gains of homes, increased leveraging on homes, non-cash gains(ie free rent), cash inputs which offset gains(tax, repairs), statistics, short term bias, tax consequences, numerical worth of "pride of ownership", interest trends, opportunity cost, all of which most people know nothing about, some of which are impossible to put a number on, working together.
Investment value of a house even varies with your income. For one to live in, it's a worse investment for a guy with 40k dividend income (ie all income is tax free anyways) than it would be for a guy making $250k, 40k dividend income because the rent he would otherwise be paying from dividends becomes tax free. But that's assuming cap gains on house + price/rent is same as cap gains + dividend returns on stocks pre-tax? Is it? Does the average person even track how much money goes into their home?
Buying a rental at 250K income means all that rent income is taxed at your top marginal. Someone who only has that rent income pays considerably less tax. Two wildly different returns for the same house being rented out. How many people are even aware this is a consideration, let alone take it into account?
The problem is people are largely blind. The evaluation begins and ends with "Well I have to have a housing payment each month. Mortgage, or renting is the only alternative, but after 25 years of mortgage payments I had a house worth 3x what I paid for it, vs 0 had I paid rent" For someone with an effective savings rate near 0 and zero knowledge of investing, this seems like an easy, reachable, ok deal. And honestly, it is.