No, it's not, not always is my point. We don't count the asset of having the home because we're comparing that part to the stock market investment.
Made up numbers: consider:
Mortgage: 2,000
Home price: 200,000
Difference from rent: -500
Rent: 1,500
Home price: 0
Difference from mortgage: +500
If (500/month invested over 30 years) > (200,000 appreciated home price over 30 years) then you came out on top by renting.
It might be or it might not be.
Also, the type of asset matters. Stock might be a more flexible asset than real estate, in which case you should probably rent depending on your location.
Made up numbers: consider:
Mortgage: 2,000 Home price: 200,000 Difference from rent: -500
Rent: 1,500 Home price: 0 Difference from mortgage: +500
If (500/month invested over 30 years) > (200,000 appreciated home price over 30 years) then you came out on top by renting.
It might be or it might not be.
Also, the type of asset matters. Stock might be a more flexible asset than real estate, in which case you should probably rent depending on your location.