God’s righteousness (or justice) is the natural expression of His holiness. If He is infinitely pure, then He must be opposed to all sin, and that opposition to sin must be demonstrated in His treatment of His creatures. When we read that God is righteous or just, we are being assured that His actions toward us are in perfect agreement with His holy nature.
God’s purpose for calling Abraham and making a covenant with him was for Abraham to keep the way of the LORD by doing righteousness and justice and to teach his offspring to do likewise. Righteousness is the divine goal for Abraham and his offspring.
When God informed Abraham He was about to destroy the cities of Sodom and Gomorrah, Abraham began to intercede for them. His concern was for the righteous in those cities. How could God possibly destroy these cities if there were righteous men and women living in them? If God destroyed both the wicked and the righteous without distinguishing them, then God would not be acting righteously or justly. And surely God, as “the Judge of all the earth,” must act justly.
God Will Choose
What if there are fifty righteous people in the city? Will you really sweep it away and not spare[c] the place for the sake of the fifty righteous people in it?
Eventually, the numbers kept reducing to 40, 30, 20 Abraham was able (so it seemed) to lower the required number of the righteous to as few as ten
Then he said, “May the Lord not be angry, but let me speak just once more. What if only ten can be found there?”
But there simply were not ten righteous in these cities. There were but four (if one includes Lot’s wife). But God, in His justice, would not deal with the wicked in a way that punished the righteous as well. He did not spare the cities of Sodom and Gomorrah, but He did spare Lot and his family by rescuing them from the city of Sodom before the angels destroyed them.
We see here in the Book of Genesis. God’s purpose in calling Abraham and his offspring to raise people by righteousness and justice. God worked in Abraham’s life to show that he was a man of righteousness and justice.