In the story God did not punish Sodom and Gomorrah for not outlawing sodomy. God punished them for preforming sodomy. Also note that God was punitive rather than preventive. This further supports the theory that God would want people to be free to choose to sin but be punished by God for sin.
Weeeellll...actually, God punished them for attempting to gang rape 2 angels. Lot told them not to and to instead gang rape his 2 virgin daughters, which God apparently thought was fine. But the gang wanted to rape the 2 angels, so they destroyed the town. Lot's wife looked back while that was happening, though, so God killed her by turning her into a pillar of salt. Then Lot settled in the mountains with his two virgin daughters. His daughters decided they wanted to have kids, so they got Lot so drunk he couldn't tell who they were and raped him, losing their virginities in the process, in order to bear his children. Again, God seems to think that this is perfectly fine.
It's a very strange story, the main moral of which seems to be that it's okay to gang-rape young virgin girls, it's okay to offer your young virgin daughters up for gang rape and it's okay to rape your father in order to have kids, but it's not okay to gang rape angels, and it's not okay to look at a city being destroyed. As I say, a very odd story.
Now, it's true that God was already planning to destroy Sodom and Gomorrah because he'd been getting complaints from people about how everybody in the place was a sinner, but the Bible is entirely non-specific about what the sin is. I'd have thought that the fact that the gang wanted to rape people would have been a worse sin than the fact that the people they wanted to rape were male, but I suppose the endorsement of raping the daughters, and the daughters raping their father rather says that rape itself isn't a sin. So I suppose homosexuality kind of becomes the sin in that specific instance by default, but it's a little tenuous. And it does mean that anyone who is citing that story as a condemnation of homosexuality is also implicitly saying that rape is okay. There's also nothing in the story to suggest that any of the other sins were anything to do with sex. It reads more like general debauchery, like it was a party town which partied too much for God's taste.
In truth, though, it doesn't read like a lesson in morality or a commandment at all. It just reads like a story which people have then attached post-hoc meaning to.