Both were Canaanite cities from the line of Ham, father of the Canaanites. The youngest son Ham got cursed by Noah who cursed his first born son Caanan. So here is where "Hamites" as I call them got off to a terrible start.
Genesis 9:24-27 (KJV)
24 And Noah awoke from his wine, and knew what his younger son had done unto him.
25 And he said, Cursed be Canaan; a servant of servants shall he be unto his brethren.
26 And he said, Blessed be the LORD God of Shem; and Canaan shall be his servant.
27 God shall enlarge Japheth, and he shall dwell in the tents of Shem; and Canaan shall be his servant.
It will remain in force.
The Canaanites were well documented in scriptures as being "bed seed" as we think of it, fit for destruction and eventual subjection to the offspring of the other two sons.
A descendant of Ham, Assur, built Nineveh. So the three wicked cities all originated from cursed Canaan, son of Ham.
The good news is that even though under a curse, one city was able to comprehend the prophet Jonah, then comprehend holy God, repent, and avoid immediate destruction. Nineveh responded to the mercy of God. Sodom had Lot in their gate. That man was a remote connection for them to God through association with Abram, though being in that gate mostly out of Asian hospitality towards visitors to the city. Men of means were often welcomed to the shelter of city leaders, as is done today even in American cities. I see in the newspaper here another esteemed visitor was awarded the "Key to the City".
May our modern day "Lots" (pastors) not console cities drowning in sins against their own conscience, leaving millions to the last resort of doubtful possible mercy of God instead of his grace through Jesus Christ..