Not to take away anything from your point: it is an interesting thought experiment. For people who have an intuitive understanding of opex v capex, it's also a very convincing argument for owning your apartment (since your mortage "feels" like opex, but is actually capex, and it's always better to spend capex dollars).
This is especially true in markets like NYC, where you might never reasonably expect to pay off your mortage (since it's a coop, or the principle is 10+ years of untaxed salary).
Would it matter the interest/equity proportions of the mortgage payments?
Also what about the other costs associated with owning the real estate (taxes, maintenance)?
In a word, yes, but oftentimes the factors you mention either break-even between renting and owning, or tilt the table in favor of owning, on a long enough time horizon. This is especially true if you're a high-income employee with a lot to gain from itemized deductions.
Interest in most loans is front-loaded (i.e. your payments are mostly "interest" rather than equity in the earlier parts of the loan), and you can write off payments towards mortgage interest on your taxes in the US. So, while interest is technically opex, the government currently allows you to treat it as capex, tax-wise, because they want to subsidize home ownership. If you aren't in a top income bracket, this won't affect you much.
Other costs are tricky because, in competitive markets at least, taxes and maintenance cost are usually priced into your rent, so you're usually paying them whether or not you own your home.
The big difference is that when you own the home, the taxes and maintenance costs arrive all-at-once (when your home floods, or the boiler falls apart), rather than amortized over years of residency. That's why mortgages are almost always "cheaper" per-month than rentals: rentals price these costs in, mortgages do not. If you have a good chunk of liquid savings and can afford good insurance, exposing yourself to occasional all-at-once payments are not very risky.
In NYC, 2/3 of households rent, according to a 2017 government survey: https://www.census.gov/programs-surveys/nychvs.html.
Not to take away anything from your point: it is an interesting thought experiment. For people who have an intuitive understanding of opex v capex, it's also a very convincing argument for owning your apartment (since your mortage "feels" like opex, but is actually capex, and it's always better to spend capex dollars).
This is especially true in markets like NYC, where you might never reasonably expect to pay off your mortage (since it's a coop, or the principle is 10+ years of untaxed salary).