I think a middle ground is possible in this specific case. The government could have said "we're placing a selective gag order, meaning you can't publish this notice but you can publish the redacted notice that we've helpfully attached", rather than wait for OWS to file a petition to publish the redacted version.