Some days, teaching can be extremely draining. The effort of putting yourself out in front of all those people and being "on" for such an extended time can be exhilirating, but can also be difficult to come down from. But on days when students take out their stress on you ... well,
You get the idea. I do think that part of the problem is that students don't recognize that professors are people too. If you invest a good deal of time into a course and (say, for example) work a good deal on a study sheet which you believe accurately reflects what a student should have learned, it isn't particularly encouraging to be told that it in no way bears on what they think they've learned. While this sort of revelation might, at times, be necessary, it is made worse when said students don't bother couching these problems in polite discourse, perhaps since they don't realize that:
Professors are people too.