Most people seem to just ignore the costs of transacting a house. They'll say they bought a a 100,000 house and sold it for 125,000 and say they made 25,000 in profits.
Neglecting the fees, commissions, insurance, loan points, repairs, time, taxes, the cost of the house sitting there vacant, etc.
What you are missing is that a home purchase is typically leveraged. You buy the house for 100K and put 20K down. The house increases to 125K and you more than doubled your money. Now take out those fees and etc. Problem is you still need a place to live and those houses have gone up in value too, so you need all of that profit for the new down payment.
Not saying this makes houses good investments, but it is something to consider. I think that this is the cheapest leverage a typically person in the US could obtain.
At least the US government heavily subsidizes leverage for real estate investment specifically, with institutions such as Fannie Mae for example. Absent that, no bank would offer a middle class individual a 30 year fixed rate loan for 80 - 95% of the value of a home. A loan to buy stocks on the other hand will typically be floating rate and the brokerage will retain the ability to liquidate your position AND require additional margin if your investments don't perform.
I think the only special thing, here, is that home purchases are the most common thing bought on leverage that can almost be seen as an investment? Only other leveraged loan that most people will do is a vehicle, and those laughably lose half their value as soon as you close the loan.