Isaac Arama, writing in fifteenth-century Spain, tells us that not only did the Jewish community leaders (שופטי ישראל) not take prostitution seriously, but in a few (קצת) communities Jewish prostitutes were welcomed and even supported with Jewish communal funds (!). This was done as the prostitutes were thought to be performing a public service, since without them it was thought that men would be led to have sex with married women or non-Jewish women (which as mentioned already could lead to execution). From a responsum of R. Judah ben Asher, we see that even in an earlier era this point had been made with regard to “loose women” (and was rejected by R. Judah who thought it was better to have sex with a non-Jewish woman for whom the niddah prohibition did not apply):
ומוטב שיסתכנו הגופים מן הנפשות
Arama tells us that on different occasions he argued with the communal leaders, and also before גדוליהם which I assume means their rabbis, that it is one thing if someone commits a sin in private. In such a case, Arama would probably agree that it would be better for a man to have sex with a Jewish prostitute than with a with a non-Jew. (It must be that these prostitutes went to the mikveh, as Arama doesn’t mention anything about the niddah prohibition.) But Arama is firm that it is absolutely forbidden for the community – and he includes in this בתי דיניהם showing that the rabbis were complicit – to countenance any sin whatsoever, in this case welcoming in Jewish prostitutes, even if this strict stance leads to people committing greater sins or being executed by the non-Jews.
Marc B. Shapiro, “The Pew Report and the Orthodox Community (and Other Assorted Comments), part 2”, The Seforim Blog (7 August 2014) [http://seforim.blogspot.com/2014/08/the-pew-report-and-orthodox-community.html]