A federal judge said the layoffs seem politically motivated and ‘you can’t do that in a nation of laws’.