There's a 5 part test laid out by the 9th circuit in Gibson v. Office of Attorney Gen related to speech rights of government employees. The government has broad latitude to restrict the speech that occurs in the course of a government employee's job, SCOTUS laid this out in Garcetti v. Ceballos. Moreover, this is an injunction related to the pending trial, and while judges can sometimes be a bit too aggressive for my taste there seems to be a compelling reason here.