Here's a relevant quote (in which the author is actually quoting Aaron McNay):
" Both employers and employees would like to be able to train the employees if the cost of doing so is less than the gains in productivity. However, there is a potential collective action problem here. What happens if the employer provides the training, but the employee then moves onto another job? The employer bears the burden of the training costs, but does not receive any of the benefits. As a result, the employer does not provide the training, and a mutually beneficial trade is not made.
By preventing the employee from being able to move, a non-compete agreement eliminates the collective action problem."
I'm not saying that non-competes are necessarily good, or necessarily bad. It depends on the circumstances. But I do think that a lot of other commenters in this thread do think that non-competes are necessarily bad, and I think that's incorrect.