Have you done a lot of teaching?
As a matter of fact, managing a course-long sequence of lectures in a way that keeps everyone engaged is infinitely more difficult than keeping everyone engaged in a one-off conference presentation.
Your entire comment supposes that the content is interesting to the entire class, that you're moving at an appropriate rate for everyone in the course. This is never the case.
I don't care how engaging the lecturer is. If it's a lecture on linked lists (or something else I already know about) then, unless I plan on teaching in the future, I'm going to get work done instead of listening. Similarly, if the lecturer takes a class period to pound in an important concept I've already internalized, I'm going to get something done while s/he catches the rest of the class up.
The only way to make sure everyone has good reason to pay attention is to teach a very difficult topic. Which is why "not paying attention" is nearly non-existent in canonically difficult courses, regardless of the quality of presentation style.