Why would you assume the universe spontaneously appeared from nothing? Because it did. And that was known 6,000 years before science discovered it.Why would I assume they spontaneously appeared from nothing? That violates every scientific stance I've ever known.
Did it violate every scientific stance ever known? No. It is possible for matter to have a beginning. In a closed universe the gravitational energy which is always negative exactly compensates the positive energy of matter. So the energy of a closed universe is always zero. So nothing prevents this universe from being spontaneously created. Because the net energy is always zero. The positive energy of matter is balanced by the negative energy of the gravity of that matter which is the space time curvature of that matter. There is no conservation law that prevents the formation of such a universe. In quantum mechanics if something is not forbidden by conservation laws, then it necessarily happens with some non-zero probability. So a closed universe can spontaneously appear - through the laws of quantum mechanics - out of nothing. And in fact there is an elegant mathematical description which describes this process and shows that a tiny closed universe having very high energy can spontaneously pop into existence and immediately start to expand and cool. In this description, the same laws that describe the evolution of the universe also describe the appearance of the universe which means that the laws were in place before the universe itself.