I bought my house 2 years ago. I lived in a 1bd apartment that was refurbished 10 years ago and paying $875 per month. The home I bought was built in 2008 and is 3bd/2ba and my payments are $836 for P&I (with taxes and insurance though the payment comes to $1085 per month) Out of my mortgage payment about $240 per month goes to principal right now. So if i still lived in my apartment and just put $240 in the bank every month is $875 + $240 = $1115, so just by buying my house, thats an extra $30 in my pocket every month, not to mention 2 extra bedrooms and 1 extra bath, the place is twice the size of my old apartment and I have a garage instead of a carport which at least once per week some jackass would park in my spot at the apartment.
In the future as rents increase,my mortgage stays the same. 20 years ago a house could be rented for $465 per month. Same home rents for about 1200-1500 today. Assuming the same inflation takes place (dont worry, it will be worse, im sure) then you can reasonable expect rents will be $3600-$4500 for an average house, while my mortgage will still bee $1100 per month meaning 20 years from now, I will be able to put $2k-3k extra per month away in my retirement account, while the renter cant.
Its the same way with someone who bought 20 years ago. Right now they are able to save $1000 more per month than renters because their mortgage is so low.
If you can live somewhere for free, vs buying your own house, then it might be worth it to just save that rent money to invest, but if you are going to be paying rent money out anyway...why are you paying someone elses mortgage and not your own?
And even if you move after only a few years, you just rent your house out and let the tenents pay your rent. If the market rents are not high enough to pay your mortgage, then when you bought you house, you just proved that you are too stupid to invest your own money anyway and this conversation is lost on you.
When I bought my house, I made sure that the payments were low enough that if i moved, I could rent it out and have cashflow. When you invest, always have more than 1 exit strategy.