I find it funny that someone would go through the pain of undertaking an endeavor as large as writing a textbook, just for themselves. For that, they already have their notes. If you are hinting that writing textbooks (good or bad) has professional consequences, sure. Are they wrong in doing so? I don't see why they shouldn't bear the fruit of good exposition.
Stretching the argument further, you might as well explain almost every action as "people do X for themselves". Kevin Simpler explores this theme in detail [1].
[1]: The Elephant in the Brain: Hidden Motives in Everyday Life (https://www.librarything.com/work/19982533/book/195649617)