The men of Sodom desired to forcibly have sexual relations with the angels who came to the city appearing as men. Such action is known as "rape." Their desire was viewed as especially evil because Lot was obligated to protect his guests at all costs, even that of sacrificing his own children for his guests. (See: [[rc://en/tw/dict/bible/kt/evil]])
Hospitality, or being kind to a visitor, was very important in the Ancient Near East. Lot showed his guests loyalty by doing his utmost to protect them from the people of Sodom.
It is probable that Abraham's faith and actions in chapter 18 are intended to contrast with the actions of the worldly Sodomites. (See: [[rc://en/tw/dict/bible/kt/faith]])