The judge cited the First Amendment in his ruling, saying it “does not tolerate viewpoint discrimination and retaliation of this type.”