Classically, this passage has been used as a condemnation of homosexuality. I would argue that should not be the case (I don't believe homosexuality is something God likes either but that is different scripture).
The situation here (there is a similar situation in Judges) is not about 2 men having sex. It is about rape. Rape is not the same as sex. Rape is a form of violence, typically a way of showing who is in power and who is not. It is done out of anger and a desire to humiliate the victims and sometimes lust but not out of love.
Let's look at the passage starting in verse 4:
Before they had gone to bed, all the men from every part of the city of Sodom—both young and old—surrounded the house. They called to Lot, "Where are the men who came to you tonight? Bring them out to us so that we can have sex with them."
Lot went outside to meet them and shut the door behind him and said, "No, my friends. Don't do this wicked thing. Look, I have two daughters who have never slept with a man. Let me bring them out to you, and you can do what you like with them. But don't do anything to these men, for they have come under the protection of my roof."
"Get out of our way," they replied. "This fellow came here as a foreigner, and now he wants to play the judge! We'll treat you worse than them." They kept bringing pressure on Lot and moved forward to break down the door.
Their sin was more than just the desire to rape. Why is this important? Because we need to look at things in context (this may not have been a context that was understood a few centuries ago in the same way however).
" 'Now this was the sin of your sister Sodom: She and her daughters were arrogant, overfed and unconcerned; they did not help the poor and needy. They were haughty and did detestable things before me. Therefore I did away with them as you have seen...' "
Rape does not equal sex. That doesn't matter if you are looking at a situation like this one or David & Bathsheba (I believe that the initial encounter was rape as well).