Still cheaper to own, if you have the initial funds or loan to buy and know you won't be leaving the area for awhile. If you rent a property those maintenance and tax and insurance and interest costs associated with owning it are just passed on to you in to your rent, plus a profit margin so the owner can make money off renting it out to you. Owning the same property would cost less, over time, and not just that, but you would have something to show for it.
What you forget is the cost of opportunity: the money that is stuck in a house is money that would yield income if it was invested somewhere else. Long term stock markets typically return 7%+, while rental return (or the rent you save by buying) can be anywhere from 3 to 7% depending on market, minus maintenance and other holding costs.
So there's no fast and hard guarantee that owning or renting is best - you need to run a proper simulation with the right parametres taking everything into account. In markets with low rental returns, renting is typically optimal.
Where is the money that is stuck in the house, that would hypothetically be able to be invested if not spent on the house? You have to pay to live somewhere, and if you're paying less to purchase than rent, that is money saved which is available to invest. Do you mean the up-front downpayment money needed to acquire a mortgage in the first place (typically 10-20% of the purchase cost), that could be invested in the market instead for a higher return than slowly building equity through principal payments?
Let me give you an overly simplified example. You are in a property market where rental yield is 3% (happens in some cities)
You could put a million dollar into buying a house and save $30k in rent every year
or
You could rent a million dollar house for $30k, and invest your million dollar in the market at 7%, returning $70k per year
Obviously this gets more complicated with mortgages, taxes, maintenance, interest rates, etc. but the gist of it is that owning your home always comes with an opportunity cost, every dollar of house equity is a dollar that isn't invested somewhere else. Depending on circumstances, renting might be the most economical choice.