A Shabbos guest asked, "Why did Hashem make it so we have to sleep?"
Actually this is a very deep question.
When Hashem first created the Universe He did not create people. He created angels. Angels are really great. They do exactly what they are told to do. Actually they do exactly what they were programed to do. They are more like spiritual machines. They do not have free will. They do not grow. They have no need to eat or sleep. Really great creations, right?
Well, it seems that they are great, but they are also boring (from Hashem's point of view not from ours). No challenge, no growth, no work, just react as their program dictates. Not only are they boring, but Hashem had another huge problem.
Hashem is very loving, but He had no one to love. How can you satisfy your love by loving a computer program, even an angelic one? So Hashem created us to have someone to give to, someone to watch grow, someone to make decisions and to be richly rewarded for their proper choices.
When you look at a mother feeding her infant you begin to see the love that Hashem has for His creation. And like the mother, as the infant grows she expects certain things from the child. Obviously, all that she wants from the child is for the child's own good, so she trains, leads, coaxes, and if need be she yells or even spanks. Ouch!
So there you have it. Hashem wanted someone to love, but He wanted them to deserve His love, so He gave us what to do. As we all know, it can be exhausting, all the things that we have to do. So Hashem, in His kindness also said, "Take a break. Go to sleep."