N1GHTS: Having been there myself, I'd say that it is mostly because, to most beginning programmers, it looks like the biggest possible challenge to their skills, and the biggest ego boost around. It is also, for a handful of developers, seen as a chance to contribute something fundamental to the field itself - if they think they have some new idea that could change how things are done (they probably don't, but they may think they do). Third, many would-be OS developers start off with only a fuzzy idea of what constitutes an operating system, a kernel, a shell, a user application, and so on; and confuse things like the GUI or the shell with the OS proper, giving them a distorted idea of what OS development takes. Finally, quite a few would-be OS developers dream of supplanting Windows with their own special OS, and imagine the accolades (and money) that would come of it.
It is a worthwhile project, and you learn quite a lot about programming in doing it, but the odds are it won't ever reach the summit you imagine it will. As for the time taken on it, you have to remember that most OS developers are hobbyists, and that the actual time spent on it is only a couple of hours a week in most cases.
The irony is that OS development is not the holy grail of programming the way many see it to be (as I say, I've been there myself, …