You can't sign a contract that allows someone to murder you -- there's case law supporting that.
But you can sign a contract that limits your future ability to speak freely.
Regardless of what case law says about this, a lot of people appear to feel that this really shouldn't be a thing, particularly when there's a large power imbalance between the parties, and when the more powerful party is obviously trying to hide evidence of malfeasance, embarrassing secrets, etc.
What is the moral thing to do if you're the less powerful party and you feel that your counterpart is acting immorally in offering you a contract like this?
Maybe the moral position is not to take the money.
Maybe it's okay to take the money and leak it anyway (assuming you think you can get away with it), because your counterpart is already irredeemably unethical, and all you can do is try to make the best of a bad situation.
I don't think it's always so clear cut. Contracts shouldn't always be considered sacred.