Because it is a convenient way to learn from other programmers.
Books are a supplement. You can only get so far so fast working on your own. Who wouldn't rather be on a project with a better programmer willing to teach you something than just read the book?
I tend to use them more as a reference rather than an "Everything you'll ever need to know about programming."