The top-level comment tried to describe the moral high ground as directly dependent on strict adherence to the letter of the contract. This is the key issue that I object to in this thread.
An action being legal does not necessarily imply that the action is also moral, and vice versa. Context matters. Intent matters.
Is it moral for a company to ask an outgoing employee to sign a non-disparagement agreement in exchange for severance? Maybe. Did the company misbehave when trying to fire that employee? Is the lawyer or HR person offering the contract aware of what happened? Is somebody that's part of this chain of events knowingly trying to use this exchange to sweep a scandal under the rug? Is the company trying to use the personal or financial circumstances of the employee as leverage to get her to agree to something she normally would not agree to (i.e. "pseudo-duress")?
If any of these things are true, I don't think it's moral for the company to ask for this exchange. Her decision to accept or reject the terms of the contract does not change this, especially if the company tried to use their position of power to influence her decision.
Now, is she acting morally in trying to break the terms of the contract? I don't think it depends on whether or not she's pregnant, but I do think it depends on whether or not the company acted morally in offering her the contract in the first place.
The moral math here is super simple. It's just karma. "If you act immorally towards other people, they might feel morally justified in trying to screw you over. Maybe they're right... maybe you had it coming."
Lots of people subscribe to this idea.