The problem with Work for Hire is this: you may be prohibited from taking specific lesson plans (in this case) outlined a specific way and using them in another district and/or publishing them online. But once you've learned the process of lesson plan making, you can't exactly UN-learn that. So what's a teacher to do? Never write another lesson plan for another district ever? How can teachers move around and change jobs under that scenario?
Ditto programming. Yeah, you can't take code and use it somewhere else line by line. But once you figure out how to overcome a specific coding hurdle, you may well face that same hurdle at another employer. You're supposed to...what? Pretend you never solved it for the first guy? Not possible, so you reuse what you've learned, if not specific lines of code. There's not a programmer out there who doesn't do this.