In 1952, Rav Menachem Eichenstein, Chief Rabbi of Saint Louis, asked about a shul that wanted to daven on ימים נוראים in a place that was normally used for all sorts of abominable practices (the teshuva does not specify what they are). Rav Moshe Feinstein forbade using such a place on several grounds:
1) We have a rule that it is a good thing to daven in the place where one learns. We can thus derive that the normal usage of a location has an impact on the davening that takes place there, and thus if the place is used for sinning then it is not a good place to also daven.
2) An advantage of davening with a minyan is the presence of the שכינה. However, such a locale would neutralize that advantage.
3) The ספר יראים discusses the case of a shul where the שמש had an affair with a young girl in the building. He rules that the shul can still be used for davening, since the shul was already designated as a holy place, and thus the individual could not make forbidden that which was not his to forbid. However, if the location was intended to be used for forbidden purposes, then it would stand to reason that davening could not take place there.
Rav Feinstein concludes that if the congregation wanted to buy this place outright and convert it into a shul, then that would be permissible.