Why are textbook authors often not the most famous/cited researchers?
You have already mentioned most of the things that are going on.
- Someone who is good at doing research is not necessarily someone who is good at writing textbooks. These are different skills.
- There are only 24 hours in a day, and an hour spent on writing textbook is an hour not spent on research. A person becomes a top-researcher by being strategic in the way (s)he manages her or his time. That often means not writing textbooks (see point below).
- The "value" of a book differs a lot from (sub-(sub-))discipline to (sub-(sub-))discipline. Some value books (but even those not necessarily textbooks), and in some writing a book is basically a waste of time.
From a mathematical (US based) perspective I would say it depends on the level of the textbook. Any proper undergrad textbooks will usually be written by people who are much more interested in being teachers than researchers and thank god for that. Undergrad texts are extremely basic and the amount of depth required or even possible, is essentially nil.
Any person with basic knowledge of the subject should be proficient enough in the mathematics to write the book without errors and with all the depth required. The important part of writing an undergrad textbook is being a good educator and teacher and being able to explain and impart the knowledge to undergraduate students. This is a skill many (if not most) high profile research mathematicians thoroughly lack.
On the other hand at the graduate and even advanced undergraduate level textbooks at least in my field of interest (set theory and foundations) were written by incredibly high profile research scientists that were probably in the top 10 in the world in their respective fields. Just to mention a few, Kunen Set Theory An Introduction to Independence Proofs, Juhász Cardinal invariants of the continuum, Chang & Kiesler Model theory. There is also the handbook of set theoretic topology which while not exactly a textbook and not by a single author, is almost an textbook and the contributors were all extremely good research scientists.
From a different field I know CGEL (Cambridge grammar of the english language) and A student's introduction to the English language, from the field of linguistics are both from Huddlestone and Pullum who as far as I can tell (I'm certainly no linguistics expert) are both extremely well thought of in their research community.
To summarize I think that the early and mid undergraduate textbooks are often written by educators, both since they would probably be quite boring for a research scientist to write (though Rudin is a household name and you certainly can't accuse him of not being a research scientist) and the educational aspect of the work is extremely important (though again Set theory by Kunen is certainly a great textbook both in terms of depth and educational values).
On the other hand late undergrad and graduate textbooks are often written by stars of the research community.
Just to complement the excellent answer from @Maarten Buis:
In my experience, the authors of the best textbooks at the senior undergraduate or graduate level are typically some of the top researchers in their field. In applied math, for instance, Gil Strang is certainly one of the leaders of the field and also the author of several extremely popular texts. Virtually all of my favorite graduate-level texts in numerical analysis and hyperbolic PDEs are written by leading researchers.
The same cannot be said for texts at the introductory undergraduate level. Top-notch mathematicians don't write calculus texts, though perhaps one of them ought to.