In a decision which was highly critical of deputy prime minister John Prescott, Mr Justice Lightman said there was no evidence he had even considered two major factors in favour of the scheme.
The minister's failure to allow the supermarket chain to comment on representations made after the end of a public inquiry into the proposals - including one made by bitter trade rivals ASDA - was 'quite wrong' and 'inexcusable' he added.
The site planned for the superstore is currently home to part of the Stockton and Billingham Technical College and William Morrison say the project will provide the funds needed to enable to the college to relocate to a central campus.
But Mr Justice Lightman said neither of those factors in favour of William Morrison's proposals had been given the slightest mention in Mr Prescott's decision letter on March 16 1999 in which he refused to grant planning permission.
The judge said: 'The failure to take into account two of the critical factors in the equation in favour of allowing the development in my view renders the decision-making and the decision open to the most serious question.
'I am satisfied that there must have been a real possibility of a different conclusion if the proper exercise had been undertaken.
'I think that the applicant (William Morrison) has suffered serious prejudice on this ground.'
After the close of the public inquiry, Mr Prescott had received further representations from, amongst others, the 'Save Our College Campaign' and supermarket chain, ASDA, who were promoting a rival scheme for a supermarket nearer the town centre.
Mr Justice Lightman said: 'As regards the conduct of the secretary of state in respect of the receipt of further representations and failure to communicate them to the applicant, I consider his conduct quite wrong and his failure to respond to the applicant's letter inexcusable.'
The minister's conduct had been 'calculated to occasion an unnecessary but well justified sense of grievance' on the part of William Morrison Supermarkets, he added.
Mr Prescott's decision was overturned and he will now have to reconsider William Morrison's planning application. There may have to be a second public inquiry.
Stockton on Tees BC has consistently opposed the superstore plans, saying they would harm the 'viability and vitality' of the town centre shopping area.