Since it's a contract, it's often unenforceable unless there is some kind of consideration. I believe in most states, if an employer asks you to sign a non-complete after you start work, it's unenforceable.
It's not a valid contract if they offer no consideration (they're demanding something of you but offering nothing in return). But they are a wealthy corporation with a powerful legal team and you are now unemployed, so they can count on you not being able to fight it. It's more like a threat than a contract - that they might be able to convince a court that it's a 'legal' agreement even if it's not a valid contract.
Noncompetes should be allowed only if the company offers to pay a minimum of market-rate salary for the duration (either what they were paying you or the best offer you've received, whichever is higher, to keep up with changes in market rates after you leave). That would then at least make it a valid contract.
But no company would want to do that, because then they'd have to pay everyone who quit or got fired for years afterward. And since the legal system is mostly controlled by corporations, that's unlikely.
The doctrine of "consideration" means that both sides have to be getting something out of a contract, or else it is not a contract at all. Lots of people have argued for or against it, and the main rationale is probably just the fact that it is traditionally defined that way. This is why you often see people selling things for nominal values like $1 or whatever.