He wasn't a king.
Also, he offered a group of angry Sodomites his daughters to rape just to get the crowd to leave him and the other dudes alone, because they showed up to rape the dudes because they weren't from there.
After his wife was turned to a pillar of salt, he flaked out of living in a city and moved the family to a cave, where said incest happened.
Ultimately, this is one of those "WTF are people doing taking this literally?" stories. It's not a convoluted story about the real and least lucky person not killed in Sodom and Gomorrah, but a 3-hour movie that should have been 3 seasons of 10 episodes about 1) showing hospitality, 2) if you're living in a messy situation, just get out of there, 3) lessons on genetic diversity among Hebrew elders and leaders 4) "proper subjugation of women!" /s 5) Yahweh hates the gays! ("It's the gays! They're trying to kill me!" -Lot) 6) Vehicle for lesson from unnamed wife about living in the past, and 7) Be careful about stealing the sperm of descendants of King David! Collectors love the stuff! (this is actually a thing in the ancient and modern world. It's all been Jerry Springer all the time since we learned to write down how trashy people are.)