I think most if not all Biblical stories are metaphorical (some have an obvious historical context). The thing I learn from this story and about others God dealt with that were doubters and questioners is that it's all right to question God. Not because he makes errors, but because God knows it's human nature to question and doubt. He knows our nature and does not condemn us for it. Being skeptical is a healthy human trait!
The sin of Sodom and Gomorrah was not homosexuality (although homosexual rape seems to be one of many crimes they perpetrated), but their general attitude of violence towards anyone who came into the city. In those times and in the Semitic culture, a person who did not welcome a stranger but took advantage of him, acted criminally towards him was the worst sort of person.
Apparently, these two cities had that reputation. They were basically being run by violent gangs of cutthroats who preyed unchecked upon every passing stranger.
A lot of things in the Bible seem awful to us because society was so different then. Hey, these people were two hairs from being baboons. They walked around armed to the teeth like Saturday night in Dodge City and were fighting all the time over nearly everything with some other tribe.
The Bronze Age into the Iron Age was a very violent time in human history. Life was generally short, brutal and pretty cheap. The Jewish law actually was quite a step up from the way most people were living at the time, and it's still pretty brutal compared to what we're used to living under.