If God is omnipotent (all-powerful), why did he take six days to create everything? Why not speak everything into existence all at once?

Astronomical data indicates that the universe began 13.8 billion years ago,1 but the earth was not formed until 4.5 billion years ago.2 Why would God wait 9.2 billion years after creating the universe to create the earth? And why would He wait another 4.5 billion years to create humans, if we are really God's ultimate reason for creating the universe? Are the atheists correct in asserting that the whole thing was an unplanned accident? The Bible actually addresses many of these issues and provides answers that tell us why God created the universe the way He did

God took six days to create in order to demonstrate order
God is a God of order, and God created in an orderly manner where the more complex follows less complex. But, some might say that the order of creation is not scientific because the sun is created after the plants. This makes no sense, so how could this demonstrate God’s order? First of all, the scientific method is not the universal standard of truth. It is an approach to understanding how the physical world operates, and it does not make predictive claims about such things as God who operates outside of the material realm.
Second, God is light, and plants can photosynthesize with any light. Technically speaking, the sun would not be necessary at this point. However, since the creation days seem to be written from the perspective of the earth, perhaps God created the sun, but it could not be seen because the atmosphere was cloudy. After he created plants, along with photosynthesis, the atmosphere would clear up and the sun would be seen. I read an article from a scientific journal (many years ago) that described what things would look like from the perspective of the earth if the earth itself were forming over long periods of time. It stated that as the earth coalesced, the atmosphere would be cloudy due to the elements dispersed within the atmosphere. Then, along with cosmic ray interaction with the atmosphere and photosynthesis, the atmosphere would clear up and the sun would become visible. It is exactly what you would see recorded in Genesis.

The six days makes sense when you look at the order of general-to-more-complex as God developed an ecosystem on earth. Perhaps God was showing wisdom in taking time to put things in order, over periods of time, so that it could be recorded in Genesis and so we could see the logic, power, wisdom, and patience of God in creation. If he is patient in creating the universe and the earth, he can certainly be patient with people through the ages who resist him.

The six days are juxtaposed with the seventh, which is a day of rest. Jesus told us in Matthew 11:28 to come to him and find rest. This rest from work is representative of the rest we receive from having to keep the law in order to be saved. The creation days represent God’s work, which was finished on the sixth day. His resting was not because he was tired. He rested from creating. The seventh day was called out specifically for us in the work week so that we would have rest. The Sabbath, the seventh day upon which God rested, typifies our rest that is ultimately found in the person of Christ.

If God instantaneously created everything and put it all in place, he would have also created evil and put it in place as well. But evil is contrary to his nature, so how could he then create everything if it included evil? This is a serious consideration because it appears that the devil had fallen into sin before Adam and Eve were in the Garden, since he was already rebelling against God when he spoke with Eve. So, perhaps God created things in the order he did because free will creatures would rebel against him, and God would not create them fallen and in rebellion.