I think there is a sutta where the Buddha says that teaching the dhamma should not be done for profit. However he did not say whether it was ok to recover the costs!
The 'usual' transaction is dana
(often offerings of food) in return for dhamma
(teaching of the Dhamma).
I think personal profit is out of the question. Personally recovering the costs (travel costs, for example) is ok IMO. Doing it for free is also great (if you can)!
There is one advantage in selling dhamma books, for example, and that is when you get into the publishing 'system' it gets easier to advertise and make it available for more people. Also reprints etc can be traced, unlike smaller free amateur publications.
I think this is one area, we cannot afford to be dogmatic.
The gift of the dhamma outweighs other gifts.
If we can get it out to more people, if people pay for it (and the advantages that has in it self for the person valuing the 'product' that was bought and also perhaps also by not devaluing what is free, and being more likely to use it because it was paid for), then so be it. But the internet is a great equalizer. So no one (as long as they can afford the internet) should be beyond the reach of good dhamma, even though some of it you might have to pay for.