Abraham knew his friend, God, pretty well: "Shall not the Judge of all the earth do right?" In a sense, he was throwing back to God the very understanding that he had of His holy, righteous character. He knew that in God's justice there could be no turning from what God is, and that His act toward Sodom and Gomorra would reflect what God is.
Well, there was probably never a more rhetorical question ever asked by a man on the earth. Even though Abraham knew a great deal about God, he may not have had a complete understanding of how far such an act like that is from God's character. There was never even a remote possibility that God would kill the innocent with the guilty in the city of Sodom.
God said, "Okay, I'll spare it for 50, 45, 40, 30, 20, 10. . . ." God could bargain like this because it is not in His mind to kill the innocent with the guilty. Why? Because for God to do that, He would have to cease being holy, and that is not possible. In essence, He would have to stop being God.
God is the supreme Judge of all the earth, and if He is unjust, there is no hope that justice will ever prevail. We know that human judges can be corrupted—they take bribes, they can be partial, they can be ignorant, and they can make mistakes. God, however, is never corrupt. No one can bribe Him. He refuses to show partiality. There is no respect of persons with Him. He never acts out of ignorance. He never makes mistakes.
John W. Ritenbaugh
Examples of Divine Justice