I got a raise of around $30,000 as a result (ish, hard to measure) of writing my technical book. I'm also sufficiently well-known that I'm unlikely to ever have trouble getting a Ruby job. That's hard to quantify exactly, but I think it's fair to say it's worth $5,000-$10,000 annually, as a rough equivalent.
(My book sells for around $30-$40 rather than $15, but the math is similar.)
Sure. Part of it is probably egoboo (and/or unrealistic expectations). But, as I wrote in another comment, a lot of people in tech depend on their public reputation for work/salary/etc. Published books help that reputation.
This is why I love books. You can get to hear what somewhat smarter than you has to say for $15. There isn't a better deal out there.