On Tuesday, Treasury Secretary Jacob J. Lew told The New York Times that the Obama administration was considering executive action to discourage corporate “inversions” — transactions in which American corporations move their tax residency abroad by being “bought” by smaller foreign firms, in order to reduce their American corporate tax bills. The same day, the Walgreen Company, the drugstore chain, ended months of speculation by signaling that it would forgo such an arrangement, but a number of large American firms are still considering these transactions.

The language about inversions has gotten heated: In a July speech, President Obama referred to inverting firms as “corporate deserters.” But I find it hard to blame the companies, which are just reacting to a fundamental problem with America’s corporate tax system: We make arbitrary distinctions between “domestic” and “foreign” multinationals, then try to tax the domestic ones more heavily.

Consider, for example, Procter & Gamble and Unilever. Both companies sell consumer products like detergent all over the world, but their tax situations are quite different. Because P.&G. is based in Ohio, the United States tries to collect taxes on its worldwide profits. We don’t try to tax Unilever’s non-U.S. profits because it’s not an American company; meanwhile, Unilever’s home countries (Britain and the Netherlands) have corporate tax systems that generally don’t tax foreign profits.

As such, P.&G. is at a tax disadvantage. If Unilever makes profits by selling detergent in France or Spain, it has to pay taxes only to France or Spain. P.&G. pays taxes in whatever countries it makes profits in; then, if taxes are lower in those countries than in the United States, it has to pay the difference to the American government when it brings those profits home. Escaping this tax disadvantage is a key reason that firms are interested in inverting.