Negative gearing isn’t housing exclusive. If you have income from more than one source and one is currently losing money you can offset against the earning source. I don’t have an investment house but have offset lost income against income from another source from time to time. You pay tax on total earnings
In housing of course you tend to make money from the deferred capital gain, not the rental stream ( fortunately for renters!) due to restricted supply and numpties wanting to increase the cost of building houses through excessive regulation ( like extra enviro regs for first home builders) and of course the government gets at that deferred income through capital gains tax.
If it wasn’t for negative gearing there would be no point in being willing to defer the income from the housing. That did not end well for renters ( who suddenly had to provide a more positive income for the investor) and investors (whose asset started falling in value as stock unlikely to earn a positive rental income was sold off) in the 1980s when the government temporarily created a special class of negative gearing for housing to reduce the amount it could be geared. It would be worse now if they tried it as asset values are much higher.
Far better for the government to release more land and ease excessive regulatory restrictions to increase housing stock to make it more affordable, less out of kilter with CPI, and thus of less interest to investors, but NIMBYs wouldn’t like that. I for example, would not like to see my house price fall. So guilty.