Why? Because apparently they need some more incentive to keep units occupied. Also, even though a property might be vacant, there's still imputed rental income there. Its owner is just receiving it in the form of enjoying the unit for himself instead of receiving an actual rent check from a tenant. That imputed rent ought to be taxed like any other income.
Many landlords don’t even pay taxes on the money they DO make.
They can depreciate a property to offset their income, even though the property is going up in value. The catch is that they have to pay taxes on more of the money they get from selling the property. But if they don’t sell, potentially no taxes for decades. And if they leave it to their kids in their will, no taxes there either and the kid’s cost basis in the property is the market value at the time they received it. So they can start the depreciation all over again.
This is how my non-expert self understands it anyway. It’s part of what draws some people into real estate.
More than that. You can depreciate the building (but not the land) to offset tax on the income but the bill eventually comes due because by depreciating it you're lowering your cost basis. For example you buy a property for $150k. If you depreciate it long enough it's worth $0. If you then sell it for $350k you have to pay tax on all $350k, not just the $200k gain in value.
However If you intend to use the proceeds from that sale to buy another investment property or properties you can do a 1031 exchange to roll your adjusted basis into the new property. Thus even when you sell it you don't have to pay the tax.
As you might, expect tax laws are written to benefit constituencies that politicians value highly. Wealthy donors are among those constituencies.