The computer-based model used by Ofqual to standardise results after exams were cancelled breached anti-discrimination legislation as well as laws requiring it to uphold standards, Labour says.
The party wants Gavin Williamson to publish the legal advice he was given.
The education secretary has backed the regulator but apologised for the hurt caused to pupils by the chaos.
Labour are calling for A-level pupils in England to be given a "cast-iron guarantee" they will not lose out on their first choice university place next month or in the future.
Mr Williamson, who is facing calls from students and opposition MPs to resign, has urged universities to show flexibility after Monday's results U-turn threw September's admission process into further confusion.
Thousands of pupils remain uncertain about which university they will end up at after Ofqual said centre and school-assessed grades (CAG) would be accepted following a furore over its process for calculating them.
The regulator has been severely criticised for using an algorithm to "moderate" the grades submitted by schools, giving substantial weight to schools' past performance as well as other factors.
This resulted in nearly 40% of marks being downgraded, in some cases by more than one grade, with high-achieving pupils from schools in deprived areas being disproportionately affected.
Labour said there had been "no proper assessment" of this year's cohort of pupils because the process used by Ofqual did "not accurately reflect" their level of knowledge, skill and understanding.
As a result, their results could not be "properly compared" with those of previous years or other exam boards, meaning the regulator was in breach of its legal obligation to uphold assessment and qualification standards.
In a letter to Mr Williamson and Ofqual's chief executive Sally Collier, Labour said the weight given to past results from individual schools had caused "a mass of discriminatory impacts".
This, it said, was "bound to disadvantage a whole range of groups with protected characteristics, in breach of a range of anti-discrimination legislation". It said Ofqual's policy of not allowing any right of appeal "beyond errors of application in the system" was also unlawful.
The opposition are pressing Mr Williamson to make clear when he was first informed about concerns about the algorithm and what legal advice he received before approving its use.
"Ofqual and the Secretary of State have been fully in the knowledge that the standardisation formula that was being used was unlawful," it said.
"It is regrettable that only when threatened with legal action that the government finally conceded to do what Labour have been calling for; for grades to be allocated based on CAGs."
The decision to allow students to use the grades estimated by their teachers - or stick to the grades provided by the algorithm if they were higher - followed similar decisions in Scotland, Northern Ireland and Wales.
Labour is seeking assurances students who received offers from universities at clearing will not now lose them.
Several institutions have said they will honour all offers made to students before and immediately after the original results were announced but many students have said their places have since been withdrawn.
Labour said this was unfair and ministers needed to "right this wrong" immediately.
It said all pupils must have their final grades confirmed by the end of the week and no-one should lose out on their first choice place "because of government incompetence".
It is calling on ministers to "bend over backwards" to support students, including by helping universities to fund additional places needed to meet the demand.
"This fiasco is far from over," Shadow Communities Secretary Steve Reed told the BBC. "There are many, many students that are still uncertain about whether they can go to university or which university they can go to.
"Every student that hasn't got their firm grades given to them needs to have them by the end of the week so they can start to make decisions about their future."
Students are being urged to contact their universities as soon as possible to discuss the options.
The government has lifted its cap on the numbers each institution can admit but some universities are warning of potential financial ruin if students switch to other institutions in huge numbers.