The church connects religion and LGBTI life. Not something the people in the painting could have imagined 350 years ago. On the other hand... this church and others were also used in the past as ‘cruising-areas’.
When this painting was made, in 1661, the word homosexuality did not exist. The word ‘sodomising’ was used for unnatural sins, such as homosexual acts, that could not be named. The expression ‘sodomy’ originates from the story in the Bible about Sodom and Gomorrah. Those ancient cities were destroyed by God because of the sins of the inhabitants.