Buying a house also has a risk: what if your house gets flooded due to a broken pipe two months after you moved in? What if they tricked you and you learnt late that the communal garbage bins are stored under your kitchen window, and the property management doesn't let you move them? When you rent, moving is "cheap" and easy, in comparison.
Also, taking on 30 years of debt is something, that mathematically might make sense, and many people handle it easily, but it's a huge mental burden to others. You take on the risk above, on the assumption that your income is stable for 30 years, but then you break your leg and get fired during corona. I don't have data on this, but 2/3 of the parents of my sister's classmates were divorced, so how do you smartly assume a stable family income for decades while not being naive about it?
This is all for "poor" people, who can't afford the risks mentioned.
Nations with higher % of home ownership don't actually end up being wealthier or have lower rates of poverty.
And if you have a nation where you have lots of apartments buildings, you can actually buy an apartment if you want. And even as a reasonably poor person you might be able to afford mortgage on a cheapish apartment.
And even if you concede this example, housing is a special category and one the largest expanses. The whole 'boots' analogy suggest this is an everyday situation.
If by the time you finish paying your mortgage, your home has a literal value of 0, you're not building wealth. This is not a hypothetical, it's like this in Japan. There are reasons to own a home, but wealth is not necessarily one.
That's you who think like a poor person. For many people on this specific forum, house is not the main source of their wealth. It's their professional services and/or investments. The former benefits greatly from flexibility provided by renting.