Tax is powerful stuff. “No taxation without representation,” thundered the American revolutionaries. It can also define the intimate details of our lives. The 18th century window tax reshaped British architecture. The abolition of Australia’s inheritance tax in 1979 put a ripple in the death rate: people clung to life to save tax until the change took effect. This was the week when tax-dodging shook the world. Confidential documents from the Panamanian law firm Mossack Fonseca – reportedly the largest data leak in history – have contained the names of Sigmundur David Gunnlaugsson, Iceland’s prime minister (he stepped aside within days), film star Jackie Chan and footballer Lionel Messi and at least 33 people subject to US sanctions.Also on the list was Ian Cameron – after wriggling all week, Prime Minister David Cameron has admitted to profiting from his late father’s offshore fund. Pressure is growing on many of those named to demonstrate that they have not evaded tax, concealed conflicts of interest or laundered illegal earnings. Hard on the heels of the Panama Papers came the announcement from the US Treasury that it was tweaking the rules on tax inversions. These are mergers that allow a smaller company in a low-tax jurisdiction to merge with a larger company in the US, reducing the tax bill.The effect of this tweak was to nullify the tax advantage of a proposed merger between Pfizer and Allergan; the deal was immediately abandoned. In some ways this has been a rather cheering week. If the rich and powerful are dodging taxes or committing financial crime, they deserve to be exposed. And if a $160bn merger makes sense only if it qualifies for a juicy tax break, it should not happen. If politicians and voters are finally taking an interest in closing tax loopholes, that is good.Yet there is also something disheartening about the name-and-shame, patch-and-mend turn the conversation has taken. Not everyone who uses an offshore financial centre is dodging tax. They are centres of expertise that can allow legitimate international transactions to take place under a sound legal system and without unpicking a tangle of clashing international regulations. And many people who dodge tax have never used an offshore financial centre. Tax systems in many developed economies are riddled with holes – the euphemism is “deductions” – created to win support from domestic interest groups. Other loopholes exist because national authorities cannot get their act together to standardise their systems. Neither leaks from Panama nor the ad hoc manoeuvres of the US Treasury fix this.People should be ashamed of evading tax but a system that is driven by public shaming has gone badly astray. Shame is an uneven incentive; it may keep celebrities, politicians and consumer brands in line but less prominent figures and corporations will escape censure.There is much more to good tax design than closing loopholes. A bad tax such as the window tax will impose costs that are missed by the tax-dodging debate. Many people feel a company that shuffles papers to avoid taxes has done something shameful. Yet when a company avoids a good investment because taxes are too high or too complex, nobody is scandalised; the tax take falls anyway and economic damage is done.Convenient as it may be to blame our fiscal strains on the Bond villain class, much missing tax has pettier causes. UK authorities publish estimates of a “tax gap” including everything from fraud to error to clever tax strategies. The group responsible for the largest shortfall was small businesses, at £16.5bn. (Individuals, at £2.9bn, were way behind.) The type of tax responsible for easily the largest, most stubborn gap was value added tax, typically dodged by smugglers, criminal gangs and back-of-a-lorry traders. If there is a connection to Panama here, it is not obvious.