Next was found to have used a tax avoidance scheme called a rate-booster.
The court ruled Next diverted UK profits to foreign subsidiaries to claim tax relief on overseas profits.
Such schemes are a way in which firms avoid corporation tax on foreign profits that are then paid back to the UK parent firm.
Under rules designed to prevent double taxation of company profits, firms were able to claim credit for tax paid on money they made overseas.
But some companies were able to exploit the rules through the creation of artificial arrangements involving what HM Revenue & Customs (HMRC) referred to as "complex circular movements of money between companies in the same group, so they can claim there has been double taxation".
Known as rate-booster schemes, this enabled companies to avoid corporation tax by diverting profits made in the UK to foreign subsidiaries.
The foreign subsidiary then paid tax on those profits - often at a lower rate of corporation tax - before the profits were paid back to the UK parent company.
Finally, the UK parent company received credits from HMRC for the tax already paid by its subsidiary.
As a result, companies were able to claim far more tax had been paid on their overseas profits than was actually the case.
Legal changes in 2005 and 2009 mean rate-booster schemes are no longer possible or attractive, HMRC added.
The Next case is the second to reach court, following a 2013 ruling against P&O Ferries, although the firm appealed against the decision and an appeal judgement is outstanding.
HMRC said about £130m in tax was at stake across 20 rate-booster cases, which were awaiting the P&O and Next decisions.
About 70 rate-boosters have already been conceded by companies that wanted to avoid going to court. This has brought in more than £500m in tax, it added.
HMRC's director general of business tax, Jim Harra, said: "This case shows how HMRC takes effective action against big businesses that try to avoid paying tax through convoluted, artificial avoidance schemes. HMRC expects all businesses to steer well clear of such schemes."
In a statement, Next said it had paid the tax owed to HMRC "some years ago" and that this had been fully accounted for at the time.
The retailer described the dispute between itself and HMRC as "a technical debate around complex legislation" which had now been superseded. It added that current UK law generally allowed companies to "repatriate their profits without a tax charge".
High Street retailer Next has been hit with a £22.4m tax bill after a court found it diverted profits made in the UK offshore to avoid paying tax.