For example, for an $800k house you would have to generally put down 160k. If you picked the right property, with enough rooms, you can cash flow around $1-2k on this which will net you around 10-20k a year, and that's not counting the tax advantage of depreciating the house which is substantial.
When you throw in the fact that the asset could/should appreciate, the fact that you can borrow against it, leverage aggressively to buy more—don't know, my reasoning could be wrong, but it doesn't seem to always be an inferior investment vehicle.
The tax advantage are really marginal since 2016.
160k$ invested in the SP500 gives you on average 16k$ a year compounding fully liquid with zero management.
Yes the place should appreciate at 3% a year historically. But even that doesn't make up for it.
(You can pay people to do maintenance tasks on your house, and if you rent then you're already indirectly paying for that. Professional landlords benefit a bit from economies of scale and such, but it's a minor difference.)
Quick note: People repeat this non stop ("The cost is passed down to the renter"). This has been proven false many times. The cost to the landlord is mostly irrelevant to the renter. Rent is set by offer and demand in a particular market. Just try to increase your place 1000$ above market rates because "Maintenance and taxes", your renters will move. So it obviously doesn't work like this.