What situations is this not the case?
If you downsize or move to a place with lower housing costs or somehow fundamentally change your living arrangement to lower the cost.
If you die, houses can be a good inheritance, but people usually want their investments to provide something during their lifetimes.
If you find a house that is undervalued and can be improved and sold for much more. However, this exists in any investment decision and is not unique to housing. Most houses won’t fall into this category or they would have already been bought and sold.
If you can fully pay off the mortgage, you’ll immediately get more monthly income and this income can be applied towards actual investments that make you money. (But you could have done this instead of paying off the mortgage too, so it’s economy dependent)