Later on I took MITx's prototype 802.11x online course, where I learned far more and managed an A. In that case the professor actually cowrote the textbook, but there was a free online copy for the online class, and the textbook was actually good.
Edit: in another case, another course at the same university used a custom printed textbook sold exclusively by the university for well over $100, that was just a few chapters from one $15 book and the complete contents of another $20 book bound together.
I know that there were ulterior motives on the professor's part because I specifically asked to just print it out myself and was told that the TAs had been specifically banned from allowing students access to the PDF version for printing.
This was a 300 person lecture taught twice per year.
300$352 is $21,000. Suddenly that looks pretty appealing to the professor who thinks he could use a new bass boat this year.
As to his profit, I'm not sure how much he made off of each book, but the book is used across the world. The only reason I think any instructor would use his book is because it's a niche subject matter; the mechanics and theory of hydronic heating systems.
If Dr. Hydronics ever reads this--you're probally a nice guy, but you made a relatively simple subject complex. Funnel your sentences. Use numbers. Don't use unnessary words. KIS(keep it simple).
I think you are seriously overestimating the financial gains such a professor would make. I've taken several classes with profs who teach from their own textbook; the profit per book sold that a prof receives is usually minimal (either because the book is sold for near cost or because the publisher takes most of the profit). In fact, most such textbooks (essentially just rigorous lecture notes) are downloadable for free anyway.
If you want to make extra money as a professor, writing a textbook and then forcing it on a single class of students is about the least effective money-making scheme I can think of.