But Lord Justice Kennedy told the parents of two-year-old Rhys Daniels, who challenged the closure after their son was denied treatment for a rare and fatal genetic disease, that he would not order the reopening of the unit or make a declaration that the authorities had acted unlawfully.
He also rejected the argument that the closure of the unit at the Westminster Children's Hospital in London on 1 April amounted to a breach of duty by Virginia Bottomley, the Secretary of State for Health.
However, Lord Justice Kennedy, sitting with Mr Justice Macpherson, admitted that uncertainty over the unit had been a 'tragedy' for Rhys as it had delayed his treatment for Batten's disease by at least eight months.
Afterwards, Rhys's father, Barry Daniels, 34, of Epping, Essex, said that the decision was a victory which would hopefully benefit children in a similar situation. It is hoped that Rhys will be given the bone marrow transplant within the next month at a Bristol hospital.
Doctors discovered that he had the disease - which leads to blindness, seizures and dementia - last year and put him at the top of the list for a transplant. Transplants are still experimental treatment for the disease, but are the only chance for Rhys who would otherwise die by the age of seven. The operation must be carried out before the victim shows symptoms, usually around the age of three.
Rhys was due for a transplant in February at the Westminster's bone marrow unit, but staff had begun to leave as they realised their future there looked doubtful, leaving too few to carry out his treatment.
The cloud over the unit's future was the result of an earlier decision to close the hospital and move the services, including bone marrow transplants, to the new Westminster and Chelsea Hospital in April.
But the viability of the unit came under scrutiny as it was not treating enough patients and the health authorities - Riverside and North West Thames - entered negotiations with Guy's hospital, the Hospital for Sick Children Great Ormond Street and Hammersmith and Fulham with a view to a merger.
However, the health authorities failed to consult Riverside Community Health Council, the body legally entrusted to oversee health-care provision, as they were statutorily obliged to do when varying services.
Lord Justice Kennedy said that even when the council got wind of what was happening and requested information it had difficulty obtaining a reply, then got a letter which was significant in 'failing to reveal the extent to which the unit had already been allowed to fade away'.
Mr Daniels said later: 'I think the judgment was excellent. The judge basically said that the closure was a shambles. He went along with us on all the points that we made.'
The judgment also said that, as the Secretary of State had suggested in evidence, the unit should be re-established in the London area, but a court order would not help in that.
Jonathan Street, for North West Thames, said the authority was still in negotiations with Great Ormond Street and Hammersmith and Fulham hospitals in the hope that the unit could be reopened.
Alan Meyer, the family's solicitor, said that the judgment was significant for the future of health-care provision as authorities would have to be more cautious when cutting services.
Law report, page 31