There are many reasons to sleep at night, but the one that might be most important is something most people do not know. All day long, you keep adding more and more memories to your brain for it to keep up with. Like a computer, your head can only keep up with so many things before it fills up, crashes, or both.
When you sleep, your are basically turning off all your input devices and giving your brain time to sort through all the data it has collected over the past day. As it analyzes the information, it decides what to hold on to (write to the hard drive) and what to throw away. Important stuff gets recorded for the long haul and the nominal junk gets tossed to make more free space for tomorrow's inputs.
The big picture is like this: If you don't get enough quality sleep, your brain gets full. Your memory gets about as useful as a screen door on submarine. The flustering for solid results also affects your mood and decision-making skills, making you not very fun to be around.
For example, if you can't remember where you parked your car or where you left your keys, your head is too full of junk and you need some sleep. If you are grumpy and frustrated with others, you haven't sorted out your feelings overnight, decided what's really important in life, and need some sleep.
Now that you know all this, pay attention to yourself throughout the day and watch it work. It's cool stuff!