Some kinds of gag orders are undisputably Constitutional. It's not like in 1790 the government couldn't do anything about someone tipping off a suspect in a criminal investigation. The Sedition Act, banning criticism of the government, was passed during the presidency of a Framer in 1789.[1] And Near v. Minnesota noted that national security issues could justify prior restraint even while striking down a restriction as violating the First Amendment. That was in 1931.
That said hopefully the government loses this one, and there is good reason for them to lose.[2] The bar for Constitutional prior restraints is very high.
[1] The Sedition Act also demonstrates how nobody ever agreed on the definition of "freedom of speech." The Federalist argument in support of the Act relied on the narrow English definition of the concept.
[2] This article in the Yale Law Journal has some good coverage of the background to this litigation: http://www.yalelawjournal.org/forum/warrant-canaries-and-dis....