Kohelet Rabbah 1:24 (citation and translation by Peter Schäfer)
[Jacob:] "It is written in your Torah: You shall not bring the hire of a harlot or the pay of a dog into the house of Adonai, your God [in payment] for any vow [for both of these are abhorrent to Adonai, your God] (Deut. 23:19). What is to be done with them (the money)?"
I [R. Eliezer] told him: "They are prohibited [for every use]."
He [Jacob] said to me: "They are prohibited as an offering, but it is permissible to dispose of them."
I answered: "In that case, what is to be done with them?"
He said to me: "Let bath-houses and privies be made with them."
I answered: "You have well spoken because [this particular] halakha escaped my memory for the moment."
When he saw that I acknowledged his words, he said to me: "Thus said So-and-so (Ploni): From filth they came and to filth shall they go out (= on filth they should be expended), as it is said: For from the hire of a harlot was it gathered, and to the hire of a harlot shall it return (Micah 1:7) - Let them be spent on privies for the public!"
This [interpretation] pleased me, and on that account I was arrested for heresy (minut).