The Capitol Hill hearing on the IRS scandal this week upstaged another Senate investigation into how U.S. technology companies shelter earnings from domestic taxes. That was just as well, since the real culprit here isn't tax-dodging corporations; it's America's absurd corporate tax code.

The Senate Permanent Subcommittee on Investigations had hoped to make a media splash by landing a big fish rarely seen in Washington: Apple CEO Tim Cook. It released a 40-page report on the eve of the hearing, excoriating Apple's use of "gimmicks" to avoid paying U.S. taxes on $44 billion in offshore income between 2009 and 2012.

Chaired by Sen. Carl Levin, D-Michigan, the subcommittee has been investigating the tax avoidance strategies of major U.S. tech firms. Last year, Microsoft and Hewlett-Packard were in the dock; Tuesday, it was Apple's turn.

"Apple wasn't satisfied with shifting its profits to a low-tax offshore tax haven," Levin told the New York Times. "It has created offshore entities holding tens of billions of dollars while claiming to be tax resident nowhere."

At issue are foreign subsidiaries that U.S. multinationals use to manage their overseas operations. The subcommittee report says that tech companies can shuffle their intellectual property as well as earnings among such entities to shield them from America's steep corporate tax rates.

Will Marshall

Cook, however, denied that Apple funnels any of its U.S. profits into offshore tax havens.

The company has amassed more than $100 billion in foreign earnings, he said, because international sales of iPhones and other products account for 61% of its revenues. Apple pays taxes in the countries where its products are sold, he told the panel, adding that it is probably also America's largest corporate taxpayer, with expected 2013 liabilities of $7 billion.

The Senate inquisitors aren't accusing the tech companies of doing anything illegal but of cleverly exploiting loopholes in U.S. tax laws that allow them to shelter income overseas. Lawmakers want the firms to "repatriate" their overseas profits so that they can be taxed here. But the companies say that would be tantamount to taxing them twice, putting them at a disadvantage with foreign competitors who pay taxes only where their products are sold.

At a time when America urgently needs to rebuild its revenue base and continue unwinding its public debts, it's little wonder that lawmakers cast a covetous eye on the overseas profits of U.S. firms. But while grilling CEOs may make for good political theater, it doesn't get to the heart of the problem: America's outdated and dysfunctional corporate tax code.

How flawed is it? Let us count the ways. First, it subjects U.S.-based corporations to a top marginal rate of 35%, among the highest in the world. Designed at a time when U.S. companies competed mainly with each other, the code now hobbles them in global competition.

Second, the code is riddled with special tax deductions, credits and exemptions, which make it both fiendishly complicated and economically inefficient. As economist Robert Shapiro noted in a recent Progressive Policy Institute study, these provisions entail significant administrative and compliance costs and, more damagingly from the standpoint of economic growth, undercut markets' ability to allocate capital to its most productive uses. They also make the code highly inequitable as some companies get breaks while others don't with little rhyme or reason other than how effective their lobbyists are.

Third, the United States is one of the few remaining countries (PDF) that has a "worldwide" tax system, meaning that we apply the 35% top rate to the worldwide profits of U.S-based companies: that is, on the profits made by foreign subsidiaries as well. Almost every other major economy has a territorial tax system, which taxes only the business profits earned in that country. While U.S. companies get a credit for the taxes they pay overseas, they are still liable for the difference between what they pay abroad and the higher U.S. marginal tax rate.

These glaring defects have engendered a rare bipartisan consensus in Washington for sweeping reform of the corporate tax code. The basic idea, endorsed by the Obama administration and House Ways and Means Chairman Dave Camp, is to radically simplify the code by phasing out special preferences and using some or all of the revenues to cut the tax rate. (Progress toward reform is snagged, however, on a dispute over whether any of those revenues should be used for deficit reduction.)

More controversial is adopting a territorial system. Some progressives are leery of this approach, since it would put the foreign earnings of U.S.-based companies forever beyond Washington's reach. But as Progressive Policy Institute economist Michael Mandel notes, those foreign profits are already taxed by the countries in which the money is earned. In today's increasingly globalized economy, it makes sense to move toward a simpler system that is easier to enforce.

Unlike Apple, U.S. lawmakers have the power to fix our broken corporate tax system. That's probably a better use of their time than villainizing America's most innovative and successful companies.