In His matchless longsuffering, the Lord would have spared Sodom and Gomorrah for the sake of ten righteous people, but not even ten righteous people could be found in those cities.
Genesis 18:20–32
20 And the Lord said, Because the cry of Sodom and Gomorrah is great, and because their sin is very grievous;
21 I will go down now, and see whether they have done altogether according to the cry of it, which is come unto me; and if not, I will know.
22 And the men turned their faces from thence, and went toward Sodom: but Abraham stood yet before the Lord.
23 And Abraham drew near, and said, Wilt thou also destroy the righteous with the wicked?
24 Peradventure there be fifty righteous within the city: wilt thou also destroy and not spare the place for the fifty righteous that are therein?
25 That be far from thee to do after this manner, to slay the righteous with the wicked: and that the righteous should be as the wicked, that be far from thee: Shall not the Judge of all the earth do right?
26 And the Lord said, If I find in Sodom fifty righteous within the city, then I will spare all the place for their sakes.
27 And Abraham answered and said, Behold now, I have taken upon me to speak unto the Lord, which am but dust and ashes:
28 Peradventure there shall lack five of the fifty righteous: wilt thou destroy all the city for lack of five? And he said, If I find there forty and five, I will not destroy it.
29 And he spake unto him yet again, and said, Peradventure there shall be forty found there. And he said, I will not do it for forty’s sake.
30 And he said unto him, Oh let not the Lord be angry, and I will speak: Peradventure there shall thirty be found there. And he said, I will not do it, if I find thirty there.
31 And he said, Behold now, I have taken upon me to speak unto the Lord: Peradventure there shall be twenty found there. And he said, I will not destroy it for twenty’s sake.
32 And he said, Oh let not the Lord be angry, and I will speak yet but this once: Peradventure ten shall be found there. And he said, I will not destroy it for ten’s sake.
President Gordon B. Hinckley said:
“Even in an evil world we can so live our lives as to merit the protecting care of our Father in Heaven. We can be as the righteous living among the evils of Sodom and Gomorrah. Abraham pleaded that these cities might be spared for the sake of the righteous (see Genesis 18:20–32).”
(“War and Peace,” Ensign or Liahona, May 2003, 81.)