It's mainly an issue of copyright. The company wants to make sure it owns the IP to every line of code you write. For example, if you do some work on the weekend they want to make sure they own the copyright to that.
Every company I've worked for had a clause in my hiring contracts. Some will enforce it more than others.
Here's some in depth discussion: http://answers.onstartups.com/questions/19422/if-im-working-...
Some may argue since I have paid for the components and not the company that would save me, but to be fair the programmer paid for his/her laptop/desktop, servers (if any), maybe even some programming tools. Does having most of the stuff to make a side project come for free make me eligible for giving up my IP to my employer? This is just insane.
Not everybody here at HN seems to realize that negotiation is not always appropriate when your first priority is to get a job.
Thankfully I've never been in that sort of situation, but I've certainly been desperate enough in the past where I would have happily signed if it didn't look like they would be willing to "bend the rules" for me.
The people I work with are brilliant (which I knew going in), I am paid very fairly, my bonuses are tied directly to my personal performance, I have flexible hours, and complete autonomy to do whatever I need to get my job done.
If I _need_ to purchase a $10,000 server to do my job, I just buy one and expense it at the end of the month. I _might_ have to explain the need when someone sees the expense, but that's par for the course. If I need to buy a USB drive to get my work done, or a relevant book, nobody will bat an eye at it.
Also, I haven't chanced it, but I'm guessing that my employer would only exercise control if I built something related or tangential to our core product. If I made an IOS game, I'm pretty sure I get to keep it... but if I build a widget that makes the support or administration of our core product more efficient to use, I'm guessing I'd have a hard time starting my own business around it without my current employer pulling out the lawyers.