As I've researched, G-d has many creations, trillions of worlds before this world, and will create many after this world.
Why did G-d create this world?
Mi Yodeya is a question and answer site for those who base their lives on Jewish law and tradition and anyone interested in learning more. It only takes a minute to sign up.Sign up to join this community
Rabbi Tzvi Freeman has an excellent article entitled "What is the Purpose of Existence?" He thoroughly examines the classical answers to the question of G-d's purpose in creating the world (to reveal His abilities, to be able to practice good etc), and explains the difficulties with them, and concludes with the explanation offered by the Chassidic masters:
As we said, G-d has no need or "reason" for creating a world. He just did it. But when He did it, He did it with a purpose. He decided to desire to have two opposites at once: A very mundane, real world... discovering its Creator in all its aspects.
G-d doesn't need a home. He's perfectly comfy doing nothing at all. He just decided to desire this. And He can decide to desire whatever He decides to desire.
That doesn't mean -- and this is crucial to note -- that He doesn't really desire it. On the contrary, have you ever dealt with an unreasonable desire? Reason has its limits, but when things are decided "just because," you are no longer dealing with anything you can work around. You are dealing with the total person.
So too, here. G-d decides, "This is what I choose to want, just because I so decided." And so, He is there in that desire in all His essence.
The creation contains only the most minimal inkling of a ray of a reflection of the Creator's light. We are all unnecessary nothings. But in His desire for His creation and its fulfillment, there He is in His entirety.
Rabbi Sadia Gaon in his famous work אמונות ודעות says god created the world because he is good and wants to "bestow good". The premise being that he need the world in order to do good. I do not like this answer as it takes away from God being omnipotent. Moreover he endes off even worse in may opinion, see below. That being said, I haven't seen any better answer in my lifetime. I think this is one of those questions that we must leave unanswered and still believe.
this notion was used by Yaakov Shweky in a song:
כי הטוב ידבק בטוב ולכן יצווה עמו לבחור בטוב והקל הטוב חפץ להיטיב
Reference: רס"ג , אמונות ודאות, מאמר שלישי at the beginning:
כיון שנתברר שהוא קדמון שלא היה עמו מאומה היתה אם כן יצירתו את העולם טובה מאתו וחסד, וכפי שהזכרנו בסוף המאמר הראשון בסבת בריאת כל הדברים. וממה שנמצא גם בכתובים שהוא טוב ומטיב...והגדול שבחסדיו על בריותיו הוא שנתן להם את ההויה כלומר מה שהמציא אותם אחר שלא היו, וכפי שאמר לנבחריהם 'כל הנקרא בשמי ולכבודי בראתיו'.