Asda said store jobs were not comparable to distribution centre jobs.
The store workers, who are represented by law firm Leigh Day, made sex discrimination claims, saying they historically got less because most store workers are women while most distribution depot staff are men.
Lawyers representing the store workers say distribution depot workers get between £1.50 and £3.00 an hour more.
Supreme Court justices were asked to consider whether Asda store workers are entitled to compare themselves to distribution staff for equal pay purposes.
Judges ruled against Asda bosses on Friday after considering arguments at a hearing in July.
Lawyers say the ruling will have implications for supermarkets and other retailers.
In 2016, an employment tribunal decided that store workers were entitled to compare themselves to distribution staff and that decision was upheld by Court of Appeal judges in 2019. Asda then appealed to the Supreme Court.
Lawyers say the store workers’ fight will not end, and litigation could run on for years. They say the next stage would involve an employment tribunal deciding whether specific store and distribution jobs were of “equal value”.
If judges decided that different jobs were of “equal value”, the litigation would then enter a third stage.
Lawyers say an employment tribunal would then consider whether there were reasons – other than gender – why people working in stores should not get the same pay rates as people working in distribution centres.
An Asda spokesperson said: “This ruling relates to one stage of a complex case that is likely to take several years to reach a conclusion.
"We are defending these claims because the pay in our stores and distribution centres is the same for colleagues doing the same jobs regardless of their gender.
"Retail and distribution are very different sectors with their own distinct skill sets and pay rates. Asda has always paid colleagues the market rate in these sectors and we remain confident in our case.”
Workers union GMB has now called on Asda bosses to meet with them and discuss the next stage of shop workers’ compensation claim, which could run to £500m.
Susan Harris, GMB legal director, said: “This is amazing news and a massive victory for Asda’s predominantly women shop floor workforce.
“We are proud to have supported our members in this litigation and helped them in their fight for pay justice.
“Asda has wasted money on lawyers’ bills chasing a lost cause, losing appeal after appeal, while tens of thousands of retail workers remain out of pocket.
“We now call on Asda to sit down with us to reach agreement on the back pay owed to our members – which could run to hundreds of millions of pounds.”