I don't think renting is better on principle - everybody should have access to housing. No matter how rich or poor. The sheer existence of renting suggests that it is only available to some.
Now I do live in the real world where this isn't the case, so let's go over my thoughts.
I think for most people, buying is better if you can. The main exception is if your only motivation is money and maximising profit, then renting will leave you on top, BUT ONLY IF you put all the money you would put into a house into a decent investment fund. And even then, okay, you're 70, take your money out but what are you going to do with all that money now?
However, there's more to buying than just the asset. You also get the security and piece of mind that this is your space that you can do what you like with. Nobody can evict you on a whim! Yes, you have to do home maintenance but that's the price you pay to have your own stuff. It's not like landlords were going out of their way to maintain it either (unless required by legislation, and even then…) The stability is good when raising children as well.