The structures are generally the majority of the value of the property.

Depends, unless you're talking about very large structures like office buildings, factories, or malls in which case the structures are definitely worth more than the land. For most residential and small-to-midsize commercial plots, it depends on where the land is. In states like HI, CA, NY, and NJ, the land is worth more than the structures on top of it, and that is triply true in cities like LA and SF.

Nonetheless it's a major expense and fully deductible.

Yes, it's generally a real property company's biggest expense. But as far as business expenses go, it's not that big compared to the expenses another business would face. (My real estate clients included a number of REITs, including a major mall chain, and the owners of a number of LA, NY, SF office towers.)

They also get to deduct property maintenance etc.

Generally, no. Under a triple-net lease, they would not get to deduct these costs because they're not paying them. Most commercial properties are leased on a triple-net basis, so the tenant is paying maintenance costs.

A group of ten individuals who get together to buy an apartment complex are not a corporation. Moreover, if the investors are a corporation, it's still one less layer of indirection -- for a corporate investor, if the real estate holding company were an S Corp you would be paying corporate income tax twice.

My statement was directed to the real world, in which most investors in REITs and real estate partnerships are corporate entities, not to a hypothetical situation.

Also, I'm not sure if you are aware of this but an S-Corp does not pay corporate income taxes, so there's only a single layer of tax whether they use an S-Corp, LLC, REIT, or LP, or GP. They're all flow-through entities for tax purposes that are differentiated primarily by their legal/compliance burdens.

This is true until the debt is paid, but then isn't that the point? They get to deduct the interest and depreciation and maintenance, and wipe out their rental income.

Yes, that's the point, but more to the point, that's the entire point of real estate investing. You make your money selling the real estate, but it's a holding game until then; you just care that you make enough in rental income to pay your debt service costs (it's not that you wipe out your rental income with expenses, it's that your expenses are covered by the rental income). This is why property owners can let storefronts remain vacant for years, so long as their rental income from the building is otherwise covering debt service.

That would result in real estate sales in low tax years, i.e. willingness to divest rather than willingness to invest. During the high tax years people would want to buy/hold and continue speculating to continue to defer paying the high taxes on the appreciation.

Right, but the flip side of you divesting is someone else investing, at appreciated costs from you paid.

The exception of course is those real property companies that are not engaged in speculation but are primarily in the business of being landlords. They have actual businesses, and correspondingly tend to spend more on upgrades during periods of higher taxes. (See, e.g., LA's or SF's office markets: prior to the TCJA tax cuts, billions or hundreds of millions spent on improving existing office buildings but since then essentially zilch.)