In the engineering industry, it is very common.
Someone can work for one employer, do virtually nothing, but learn the trade secrets and just go and sell them to the competition.
That would be a field where such agreements are legit. Even without a non compete clause other laws such as those dealing with proprietary, and intellectual property would certainly come into play.