Mr Justice Sedley ruled that Wealden district council in East Sussex and Lincolnshire county council were legally in the wrong in failing to make proper inquiries about the travellers before taking decisions to remove them.
But the Lincolnshire travellers may still be evicted because the county council did assess their situation properly before moving on to obtain a removal order from magistrates.
The two groups of travellers, including several pregnant women and mothers of young children, had launched the first legal challenge to the Government's new anti-trespass laws.
In the Lincolnshire case, the council made a direction in early June requiring all travellers to leave land at Ermine Street in the parishes of Temple Bruer and Wellbourne.
Grantham magistrates subsequently authorised council officials to evict the travellers - about 80 in number - but an injunction halted their removal pending yesterday's judgment.
In the East Sussex case, the council made a direction in February against 46 travellers at Phie Forest Garden, St John's Road, Crowborough, and in March local magistrates authorised their removal.
An injunction was again obtained to prevent the removal of at least six women, all pregnant or with young children, from the 42-acre site.
The judge, in summing, said it was necessary to consider the relationship of a council's proposed action on the various statutory and humanitarian considerations at the initial stage of deciding whether or not to give a removal direction, and for this to be reviewed as necessary.
A series of in-depth inquiries were made about the situation and needs of the travellers by Wealden district council following the making of the removal order.
But the local authority omitted entirely to inform itself of potentially relevant matters before seeking that order.
In the Lincolnshire case, the judge refused to quash the removal decision because the council did not continue to ignore the traveller's personal circumstances until after a removal order had been obtained.