Out of curiosity, has there ever been a gag agreement that wasn't put forth by an absolute asshole to cover up their asshole behavior? Like are they ever used for good?
By their very nature, gag agreements tend not to go public. Therefore, we're probably not going to get any stories of "good" gag agreements in the news.
Yes; among the kinds of restraining orders against assholes, there can be provisions against certain kinds of public speech on certain topics (e.g. which would be harassing to someone).
They can be used in court cases to avoid biasing the public/jury before the case is heard to completion. Depending on your perspective you may see this as protecting the assholes involved but its intent is for a balanced and impartial hearing.
Non disparagement clauses are gonna be common in any settlement where the other party has the legal upper hand. A wrongful termination would be an example, where the settling party would want assurances the manager won't pull a Marty on reddit.