There are dozens of former Christian churches in just such a predicament.
If the diocese doesn’t want sodomy in a particular building subsequent to having sold that building they should raze the building and simply sell the property.
It would be better had these deconsecrated churches been razed and the property itself sold. Western Europe is full of such ‘churches’.
I guess if you put it that way, there is plenty of sodomy that has gone on (and likely still does) in plenty of houses of worship!