Or maybe, instead of ditching the stuff that's not necessary, the brain might be reinforcing the stuff you do need. Scientists have seen that, when rats were asleep, the same neurons fired as when they had run mazes earlier that day. That means that the rats are essentially reliving their day and "practicing" the maze. This has led Harvard sleep researchers to assert that sleep is crucial for humans to form memories and to learn.
But there's a problem with both of these theories. Plants and microorganisms, otherwise known as "things without brains," have dormant states that are very similar to sleep, which kind of puts doubt on the whole "sleep is good for the brain" theory. Then there's the fact that scientists have found certain humans who can go without sleep with no ill effects. There's even one dude who claims he hasn't slept a wink in 33 years.
In fact, all of these theories kind of went out the window when researchers discovered a gene mutation that allows people to sleep two to four hours a night without any adverse effects at all. So, is sleep useless, then? Is it just God's way of making us take a break between masturbation sessions? Your guess is as good as science's.