A planning inspector has been accused of making a "perverse or irrational" decision for allowing travellers to remain on an unauthorised rural site.
High Court judge Mr Justice Forbes ordered Deputy PM John Prescott's department to reconsider the case of Patrick McCarthy, 68, and his wife.
They had moved onto land at Cottenham, Cambs, without planning permission.
The judge ruled inspector Clive Woodhouse was wrong to overturn a council order aiming to end occupation.
Last February, planning inspector Mr Woodhouse overturned an enforcement notice which South Cambs District Council had issued.
The inspector ruled that, as the travellers' caravans were in the corner of an area of authorised sites, they were not unacceptable.
Mr Justice Forbes overturned this and also quashed the inspector's decision to allow retrospective permission for caravans, used by the McCarthys and their 18-year-old grandson, Daniel O'Rourke.
Travellers had bought pitches at Setchel Drove, a concrete fen road near Cottenham.
Mr Justice Forbes said the inspector had made no mention of the "strict restraints" on development contained in the then current development plan.
Instead the inspector referred to a draft replacement policy that had no application to the family.
The judge ruled: "I am driven to the conclusion that the inspector's planning judgment was flawed by an incorrect approach to the relevant development plan and policies.
"He also took into account immaterial considerations and reached a decision that was accordingly perverse or irrational."