“Actually, we know what inspired the Biblical story of Sodom. Why do you think they call it . . .”
Note that at that point in time, there was no Ten Commandments and no Hebrew Bible, in which the prohibition against “a man laying with another man as a woman” was first stated.
I don't know what was their greatest sin. (Although I agree that Our Lord made plain that offenses against charity--which cover a wide range of bad actions--is the grandaddy of all sin.) We just know that sodomy was enough, and was the matter at hand.
Before this, you had Abraham bargaining God down, saying, "Lord, what if I find TEN just men--then will you then spare the city?" It is then that the narrator recounts with apparent emphasis how the men of Sodom repeatedly demanded that Lot introduce them to those men, who were actually messengers from God (angels), "that we may know them." The Sodomites use that same verb every time as the group grows larger and larger, threatening Lot for holding the door against them--finally surrounding the house until every male in the city is among them, and Lot is entreating them not to "act so wickedly"--and offering them two young girls instead. They refuse that offer, furious that this "sojourner" would "play the judge" with them and roaring, "Stand back!"
That's when the angels pull Lot inside the house with them, hold the door themselves with no apparent effort and strike all the besiegers blind.
That's what makes it plain which meaning of the word "know" the narrator is intending--it's not an ordinary howdy-do--and that not even one man in Sodom was innocent of it. And that it was enough to merit what followed.
That it was before the unveiling of the Big 10 is not material here. Murder was recognized as a sin (Thanks, Cain!) long before the Ten Commandments, so it's not a shocker that sodomy was also. It is plainly stealing and corrupting a mystery given to us by God.