The judge has stayed the ruling pending an appeal from the Trump administration.