Though he brings grief, he will show compassion, so great is his unfailing love. Lamentations 3:32
After Abram is kicked out of Egypt, He and his nephew, Lot, decide to split land and go separate ways. Abram was rich in livestock, so he let Lot choose which land he wanted and told him to tend to his own and there wouldn't be a controversy between them.
Lot finds himself in trouble with the kings of Sodom and when Abram hears about this he turns to God for help. God wants to wipe out the whole town of Sodom because the people in it are evil and the town is wicked. But Abram tries to plead with God, and spare the good people in the town. Abram believes there has to be few that are good and he would also like for his family to be saved from God's judgement. After Abram fights the kings and wins, God spares Abram's nephew, Lot, and his wife. However God gave Lot's wife specific instructions not to look back at the town being destroyed but she didn't listen, so God turned her into dust.
Because Abram showed great compassion for the people of Sodom, even when they weren't worthy of such compassion and grace, Lot was spared. Abram was able to see good in some and wanted to help others in hopes they could become good. Because of this, God blessed Abram and his heirs with more land and wealth.
The message of this story is that we too shall have compassion for others even when we feel they're undeserving. God's judgement can be harsh and sometimes not what we want, but if we continue to give others second chances and believe in them, God will reward and bless those greatly.