Why don't more academics write textbooks? For example for an undergrad CS/ECE course, say Intro to Computer Networks, there are about 5 textbooks published by the top 15 publishers in the last 20 years. Why aren't there way more textbooks, since there are probably tens of thousands of people (academics) who have the necessary knowledge to write such a book.

Is it because:


publishers don't publish a book about a topic for which they already published a book previously;
or academics don't think writing a textbook is beneficial for their careers and royalties are very low?
As in the other comments and answer: it's a lot of trouble, doesn't generate money, and doesn't generate status, either. In fact, it often generates anti-status, for various reasons: because of the other features, many academics (I'm in mathematics) would never consider writing any sort of book at all... and many of these people seem to subliminally want to rationalize this as a positive virtue by denigrating anyone who does write a book (especially a textbook). This is a fairly typical mechanism: declare the desired state a virtue... I've had "colleagues" say to me, quite snarkily, upon hearing that I was working on a book, "Oh, you must have a lot of time with nothing to do!" Sigh...

It is also true that there is pressure from publishers to make new textbooks as similar as possible to old textbooks... which perpetuates certain features that one might decide are not so good. That is, understandably because publishers want to sell books, a new textbook "has to" resemble existing ones enough to compete in the market for those books. 

Another disincentive, of a different sort, is the point that nowadays with an internet, one needn't have pseudo-perfected a body of material before putting it on-line, because it can be corrected, tweaked, etc., indefinitely. In contrast, a physical book's immutability creates pressure for a degree of perfection that is (relatively) very expensive (if only in time and energy), due to severely diminishing marginal returns. The very linearity of a book creates similar somewhat-fake problems... And physical books are not searchable! It's crazy! :)

So, I personally have written some texbooks, didn't make much money... Nowadays, I mostly just put textbook-like material on-line, thus without the constraints of old-timey publication. This similarly generates no status-points at all, and no money. :)