It's the age old buy-vs-rent debate. Yes, if you don't plan to live in one spot for years on end then you may be better renting (or living on a boat, or out of a campervan, or a tiny home, or whatever takes your fancy).
But if you do stay put for years, then you can either pay rent to a landlord or repayments off a mortgage, and in only one of those cases do you end up with an asset to show for it, not to mention being able to alter it however you want and not having the worry of being evicted one day.
What I don't like in the housing market is speculative investors who do just buy for the capital gains, in some cases even leaving properties vacant for years. That doesn't do anything for the housing shortage. Airbnb etc is another problem (and yes I'm guilty of staying in them, and will again) because if your house is in a holiday area you get far more money from short stay accommodation, even with cleaning/maintenance, than you do from long term renters.