In an old blog post at Siris, Brandon Watson remarks:
Incidentally, on a complete tangent, when reading up again on what Thomas says about property and almsgiving, I suddently realized something that I don’t think I ever realized before: Thomas doesn’t think it’s immoral to receive payment for sex. He does, of course, think fornication and adultery immoral, and thus prostitution to the extent that it involves these; but he explicitly says that when a woman takes money for it she is not doing so unlawfully or unjustly.
The source, I believe, is ST II-II, q. 87, art. 2, ad. 2, in a question about whether the church should accept ill-gotten tithes:
On the other hand certain things are said to be ill-gotten, because they are gotten of a shameful cause, for instance of whoredom or stage-playing, and the like. Such things a man is not bound to restore, and consequently he is bound to pay tithes on them in the same way as other personal tithes. Nevertheless the Church must not accept the tithe so long as those persons remain in sin, lest she appear to have a share in their sins: but when they have done penance, tithes may be accepted from them on these things.
James A. Brundage has an article (‘Prostitution in the Medieval Canon Law’, Signs 1(4), pp. 825-845) that adds some background to this. Aquinas was not alone in his idea (pp. 837-838):
When it came to dealing with the property and property rights of prostitutes, the canonists followed very closely the doctrine of the classical Roman lawyers, which was still current law in many secular jurisdictions in the Middle Ages. Money given to a prostitute could not be reclaimed by the donor, according to this doctrine: the client had no right to take back the money he had paid for her sexual services. She, for her part, committed no wrong in accepting the money … The customer who paid the harlot her fee might be held wrong to give money to her; but her acceptance was perfectly legal … Cardinal Cajetan, incidentally, stipulated that a prostitute, in order to be entitled lawfully to retain what she earned, must charge only a just price for her services…
However, prostitutes did not enjoy full labor rights (pp. 838-840):
The wilier customer, who paid in promises of future gifts, could renege on his promises and the prostitute could not legally secure enforcement of them … A prostitute could not denounce a criminal, nor were the courts to hear a harlot’s complaints about wrongs done to her. This attitude was consistent with the teaching of the Roman lawyers.