Negative gearing is a middle class welfare measure designed to keep property prices artificially high and spur speculation in the property market.
There are a lot of Baby Boomers out there with inadequate or non-existent savings/superannuation for retirement, which will mean a tremendous burden on the welfare system when it comes time for them to retire - something that the expected tax base will not be able to handle. The result, under normal circumstances, would be to massively restrict pension eligibility and benefits to all but the most needy and create a huge problem with elderly poverty.
Now, many of the boomers have no money, but they do have assets in the form of property. If a government were to promote growth in the price of what assets these people do have, it will mean that they can draw upon these assets in retirement and ease the burden on the taxpayer.
By allowing you to claim negative returns from leveraged property investments as deductions on your income tax, the government essentially removes the risk and subsidises your losses, but also lets you keep any profit you might make on the capital appreciation of the property without reference to losses incurred over the life of the investment.
In any other market, an asset that was purchased on credit for $50K that was later sold for $60K, generated revenues in that time of $10K but incurred interest and maintenance costs of $30K would be considered a stinker that lost you ~$10K. In a market with negative gearing, however, that same bad investment made you $10K richer. Provided your income tax bill is high enough (i.e. you are rich enough), it doesn't matter if that investment lost $100K over its life, you are still $10K richer (OK, ~$7.5K after tax) because the taxpayer absorbed your losses.
This basically encourages speculative behaviour, which drives up prices, because it allows buyers purchase not on the basis of utility, but on the expectation that prices will rise. What's worse is that to fully take advantage of it, you want to maximise your debts to do so, meaning that not only are you deliberately making bad investments, you're making bad investments that you cannot afford and all underwritten by the taxpayer.
The reason the government allows this to continue is that they expect that it will cost less in the long term to subsidise these terrible investments than to support the investors financially in retirement. It is basically a scheme where the rich and middle class are paid their retirement benefits today in the form of tax credits so that the government doesn't have to shell out actual cash to them tomorrow.
The consequences are an inflated property market and an electorate/government that has a vested interest in keeping prices high. Hence the glacial pace of land releases for development in a country with one of the lowest population densities in the world, hence the doom and gloom that happens at every lull in the property market, hence a generation of people who will never be able to afford to own their own home.
Negative gearing is almost the exact opposite of a capitalistic or free market policy. It is welfare for the rich and middle class and it is a terrible policy that unfairly shapes our economy.