The Torah contrasts two very different personalities, that of Avraham and that of Lot his nephew. Both born into the same society, both wanted to escape the corruption of Ur and Haran and both migrated together to Canaan. They become shepherds, an interesting change of career given that initially they were city dwellers. Famine forces them down to Egypt where Avraham and Lot prosper. But when they return to the hills of Israel their employees began to see themselves as competitors and fought. Avraham and Lot agreed to separate. Avraham gave Lot the choice between the hill country and the plains. Lot decided to relocate to the most outwardly attractive location, down near the cities of Sodom and Amora (Gomorrah comes from the fact that Greek translators had no equivalent of the Hebrew letter Ayin).
We cannot fault him entirely on his choice. After all, had he chosen the hill country Avraham would have had to accept the Sodom location. But as the narrative expands it becomes clear that although the choice might have been good commercially, morally it was dangerous. Interestingly Lot chose to move back into a city rather than stay outside living in tents. Luxury got to him. He allowed Big City life to seduce him.
The men of Sodom hated foreigners and they did not like being charitable. Most commentators say they were corrupt in general, ignoring basic morality. The association of Sodom with Homosexuality was a later Greco-Christian import! Nevertheless, Lot tried to adhere to the values of Avraham and offered hospitality to the men/angels who visited him. This lead to conflict, confrontation and Lot and his family were rescued before Sodom was destroyed.
We can learn from this that although Lot might have admired Avraham and accepted his moral code, still he yearned for the temptations of corrupt city life. As indeed did his wife. He was corrupted by the society he lived in when he offered his two daughters up to the men of Sodom.
The moral is clear. Humans are easily tempted. Even good men find it hard to resist. That is why one needs a very strict moral and religious code to be part of society without giving in to its destructive temptations.