Jude 1:7
ESV - 7 Just as Sodom and Gomorrah and the surrounding cities, which likewise indulged in sexual immorality and pursued unnatural desire, serve as an example by undergoing a punishment of eternal fire.
For follow-up discussion and general commentary on the topic. Comments are sorted chronologically.
We often examine a passage of scripture like the history of Sodom and we pass judgment (right and wrong, good and evil, sin and righteousness) based on what we see recorded in the bible. But God judges the thoughts and attitudes of the heart. As Jesus said, a good person produces good deeds from the good stored up in their heart, and an evil person produces evil deeds from the evil in their hearts.
The whole bible records how God reveals himself to human beings, and then waits to see how people will respond - in faith or disbelief. God reveals his nature and character, his plan and purpose and his way of salvation (repentance & faith) to every human being.
The longer and stronger God's revelation is, the greater the punishment for rejecting God's love and mercy. Jesus said the same thing about the towns of Capernaum and Bethsaida in Matthew 11:21-24. Sodom will be better off than Capernaum on the day of judgment.
God did the same thing with the whole land of Canaan. The patriarchs (Abraham, Isaac and Jacob) witnessed God's love and mercy to all these people groups for hundreds of years but they rejected it. Over 400 years after Jacob left Canaan, God brought the nation of Israel back there to annihilate every living thing from the land. This was not for the sin of homosexuality (which was still rampant), it was for rejecting God's love and plan for their salvation, after God had pleaded with them for hundreds of years (2 Peter 3:1-18).