Rabbi Eleazar said: Even for the sake of a single righteous person the world was created, as it is said, "And God saw the light, that it was good" (Genesis 1:4). And "good" means nothing other than the righteous one, as it is said, "Say of the righteous one that it shall be good" (Isaiah 3:10).
The World Created for a Single Righteous One
Yalkut Shimoni on Torah 5:1
אָמַר רַבִּי אֶלְעָזָר, אֲפִלּוּ בִּשְׁבִיל צַדִּיק אֶחָד הָעוֹלָם נִבְרָא, שֶׁנֶּאֱמַר וַיַּרְא אֱלֹהִים אֶת הָאוֹר כִּי טוֹב וְאֵין טוֹב אֶלָּא צַדִּיק, שֶׁנֶּאֱמַר "אִמְרוּ צַדִּיק כִּי טוֹב".