And some aspects of the agreement would be fine. No spilling actual business relevant secrets, nothing that would count as libel or slander, etc.
Companies don't need to offer severance to prevent ex employees from spilling business secrets, doing so is a criminal offense.
Is there an incentive to have unenforceable clauses? Yes, of course. The same way one might be incentivized to say they will harm you if you do not do what they want even if they have no intention of harming you.
It's called "a bluff". Play some poker, you'll see how effective this strategy really is.
Best example in software are non competes.
A company can make you sign something that doesn't allow you to do any software development when you're a developer. You can sign that today then do the opposite tomorrow because that's just against the law.
See:
https://news.bloomberglaw.com/daily-labor-report/did-califor...