This question was suggested to me by How can I sell my text book to my students in e-book format? which asked about the practicalities, but attracted many comments about the ethics.  So this question is to ask about the ethics directly.

Suppose I have written and published a textbook, and I want to use it as the text for a course I am teaching.  I receive royalties from each copy of my book that is sold, so if my students are required to buy my textbook for the course, I will make some money.  Is it ethical to do so?

Well-reasoned opinions would be useful answers, but even more useful would be pointers to institutional policies, professional codes of ethics, etc, that address this issue.

Of course, there are many ways to avoid profiting from the sale of my book to my students.  If my contract with my publisher allows it, I could distribute PDFs to my students, or have the university bookstore print out copies and sell them at cost.  Another approach I've heard of is to compute how much I earn in royalties on each copy, and refund that amount from my pocket to each student who buys a copy.  Or, use my royalty earnings to buy pizza for the class.  Certainly these are nice gestures, but I would like opinions on whether they are ethically required.

Edit: To address some questions that have arisen in the comments:


This question is hypothetical.  I haven't published any textbooks myself and have no immediate plans to do so.  In any case, my personal preference would be to make the book available to students for free, if at all possible.  So I've phrased this question in the first person for rhetorical convenience only.
I had intended the question to be only about the potential financial conflict of interest that could arise if I make money by assigning my own book.  Some of the answers feel that it is improper for me to assign my own textbook at all, whether I make money or not, but I don't think this point of view is prevalent within the academic community.  If it happens that my book (as a pithy but now-deleted comment put it) "blows", I think most would agree that my decision to assign it is pedagogically unfortunate, but not unethical.  
I don't literally mean that students would be required to buy the book, only that they'd be expected to have it.  I might assign readings or homework problems from the book, so that the student needs access to the book in order to do them, but they could certainly achieve this by getting a used copy or borrowing from a friend.  But probably most students would buy new copies anyway, since that is the most convenient way.



Question: How are potions made?
Answer: 
  "As there is little foolish wand-waving here, many of you will hardly believe this is magic. I don't expect you
  will really understand the beauty of the softly simmering cauldron with
  its shimmering fumes, the delicate power of liquids that creep through
  human veins, bewitching the mind, ensnaring the senses.... I can teach
  you how to bottle fame, brew glory, even stopper death -- if you aren't
  as big a bunch of dunderheads as I usually have to teach." (Severus Snape to First Years, HP and Philosopher's Stone, CHAPTER EIGHT "THE POTIONS MASTER")


In Chemistry (which potion-making is a clear magical equivalent of), there's a concept of catalyst. A catalyst is a chemical which facilitates a given chemical reaction, without actually being consumed as part of it. Usually a fairly small amount of catalyst is enough to affect the reaction.

It seems to me, based on what small info was provided in the books/interviews, that magic in brewing the potions is strongly equivalent to the catalist in a chemical reaction. It aids the potion-making, but isn't there to provide "energy" to it. 

This is confirmed by the fact that you tend to boil your cauldrons in Potions using fire - this is what would have provided the energy.


  "I suppose you added the porcupine quills before taking the cauldron off the fire?" (same source).


This pretty much answers your main question - the majority of the energy comes from the fire, as is frequently the case with chemical reactions. But some of it can come from the ingredients themselves when reacting.

As such, it seems unlikely that magic involved in making potions is in need of being especially energy-draining, even if it may be somewhat tricky or complicated.