FOR 50 years, savvy Americans have enjoyed a sales-tax loophole. By ordering a product from an out-of-state company, consumers could often avoid paying the tax their states and cities impose on purchases. Consumers had two Supreme Court decisions to thank for the savings: long-standing rulings that have prohibited states from requiring stores with no physical presence within their borders to collect sales tax on purchases. But on June 21st, the justices voted 5-4 to end this half-century-old gift.

The ruling in South Dakota v Wayfairfeatured an unusual line-up. Swing Justice Anthony Kennedy, who all but invited the lawsuit by noting his displeasure with the precedents in 2015, was joined in his majority opinion by three conservatives (Justices Samuel Alito, Neil Gorsuch and Clarence Thomas) and one liberal (Justice Ruth Bader Ginsburg). The dissent was penned by the rather conservative chief justice, John Roberts, and signed by three of his liberal-leaning colleagues (Stephen Breyer, Elena Kagan and Sonia Sotomayor).

Justice Kennedy’s opinion giving the push to National Bellas Hess Inc. v Illinois Department of Revenue (1967) and Quill Corp v North Dakota (1992) boils down to two central points. First, there is a lot of revenue at stake for the 45 states that charge a sales tax. “It is estimated that Bellas Hess and Quill cause the states to lose between $8 and $33bn every year”, he wrote. This amounts to “an extraordinary imposition by the judiciary on states’ authority to collect taxes and perform critical public functions”. In light of pinched state budgets and all that money left on the table, it’s no wonder that in a friend-of-the-court brief, “41 states, two territories and the District of Columbia now ask this court to reject” the physical-presence test. The rule “intrudes on states’ reasonable choices in enacting their tax systems” to fund “police and fire departments”, pave “public roads” and provide “municipal services that allow communication with and access to customers”.

Second, the majority opinion focused on the “competitive disadvantage” created by the loophole for stores with a brick-and-mortar presence within a state’s borders. “Remote sellers”, Justice Kennedy wrote, “can avoid the regulatory burdens of tax collection and can offer de facto lower prices caused by the widespread failure of consumers to pay the tax on their own”. He noted that one of the three corporate litigants in the case, Wayfair (a home-furnishings retailer), highlighted its websites lower prices: “‘[o]ne of the best things about buying through Wayfair is that we do not have to charge sales tax.’” This is a “subtle offer to assist in tax evasion”, Justice Kennedy wrote. (States do ask taxpayers to remit a “use tax” equivalent to what they would have paid in sales taxes, but compliance is low.)

In the four landmark gay-rights cases he authored, including the 2015 ruling opening marriage to same-sex couples, Justice Kennedy drew on the “equal dignity” of LGBT people. He seems to have something like that principle in mind for brick-and-mortar stores aiming to compete with web businesses. Imagine two online furniture companies, he wrote: a piddling one located in South Dakota and a major retailer just across the border in Nebraska featuring a “sophisticated website with a virtual showroom accessible in every state, including South Dakota”. The first business, under Quill, “must collect and remit a tax on all of its sales to customers from South Dakota” while the second—despite its “pervasive Internet presence"—has no such duty. “This distinction”, Justice Kennedy wrote, “simply makes no sense”.

In his dissent, Chief Justice Roberts took issue with the majority’s claim that tax rule brings fiscal devastation to the states. “Some companies, including the online behemoth Amazon”, he noted, “now voluntarily collect and remit sales tax in every state that assesses one—even those in which they have no physical presence”. So if the Bellas Hess and Quill rule “is harming states, the harm is apparently receding with time”. But this was not the main argument. In fact, the chief began by noting his agreement that “Bellas Hess was wrongly decided, for many of the reasons given by” the majority. The point of contention was not whether the 50-year-old physical presence rule was the right one, constitutionally—all nine justices seem to agree it wasn’t—but whether the court in 2018 should overrule a decision that has been standing since 1967.

The Supreme Court “does not overturn its precedents lightly”, the dissent noted, quoting a 2014 case. And there are particularly good reasons for the justices to demur from wiping out the sales-tax regime. “E-commerce has grown into a significant and vibrant part of our national economy against the backdrop of established rules, including the physical-presence rule”, Chief Justice Roberts observed. “Any alteration to those rules with the potential to disrupt the development of such a critical segment of the economy should be undertaken by Congress”. It is wiser for the Supreme Court to defer to lawmakers than to act on its own on an “important question of current economic policy, solely to expiate a mistake it made over 50 years ago”.

The justices will soon have another opportunity to weigh the merits of abandoning old precedents with significant implications for America’s economy. A ruling next week in Janus v AFSCME will determine whether a 1977 precedent laying out a funding framework for public-sector unions will be reaffirmed, modified or scrapped. In the meantime, Americans wishing to save the sales tax on online purchases had better get going: several states, including North Dakota, have already passed laws forcing companies to collect the taxes.