Why does the U.S. tax code encourage debt?

I'd always taken the U.S. tax code for granted when it comes to tax shields for debt. Individuals can deduct mortgage interest, and companies can write off interest on debt. These nudge players towards debt, all things being equal. When I first joined Amazon.com, we were looking for more funds post-IPO to finance all the investments we wanted to make over the next several years, and we went with what was, at the time, the largest convertible debt offering ever. The internet market hadn't crashed then, and debt was the cheapest way to fill our war coffers.

But, as James Surowiecki notes, even without these tax shields, debt would be prevalent in the U.S. (after all, most people can't pay for an entire house with cash, and most companies love the leverage of debt). Even worse, these tax shield for debt have almost no social benefits while magnifying risk, as the recent financial crisis exposed all too well.

Surowiecki notes that while abolishing these tax breaks will be politically challenging, other countries have done it.

...there are precedents, on a smaller scale, for these kinds of changes. In the U.S., people used to be able to write off the interest they paid on credit cards. That tax break was abolished in 1986, and, the same year, the mortgage-interest deduction, which used to be unlimited, was capped. Great Britain, meanwhile, abolished its mortgage tax break in 2000. Similarly, there are a number of countries, including Brazil and Belgium, that don’t give corporate debt a tax advantage over equity, while, just last year, both Germany and Denmark cut back sharply on their business-interest tax breaks, limiting how much interest companies can write off. Given the weak state of the economy and of housing prices, a wholesale rewriting of the tax code may be a bridge too far right now, but there are plenty of reforms—capping deductions, phasing them out over time, restricting their use by heavily leveraged companies—that would move in the right direction.