Agreed.
Housing is the tool most middle class people use to store wealth....as opposed to ETFs, Mutual Funds etc.
The stock market has always had more consistent ROI while housing is a roller coaster ride.
All things being equal, buying makes more sense but things are not always equal. The $50k someone saved up could be invested in the market and earn a decent 5, 6, 7% return every year. Instead of sinking it into a home that requires repairs, HOA fees, property tax etc., the money can be put to work immediately and then you rent.
The renter vs buyer comparison tends to ignore the fact that most buyers have more money to start with....that's why they can afford to buy in the first place. At the very least they've received cash infusions from family members to get them set up.
Those "white people have higher net worth than black people" articles point out the dollar differential but ignore that the gap is almost entirely predicated on one group having all of their wealth tied to their homes and the other group not being able to afford buying...or they buy in less expensive areas.