I heard about a study on the radio recently that was done on the brains of mice. The study provided evidence that sleep appears to play a crucial role in clearing the brain of proteins that accumulate due to the metabolic processes of brain cells. Scientists are apparently intrigued by the possibility that this may actually be THE primary reason for sleep, which occurs in pretty much every animal on the planet with a central nervous system.
If I understood it correctly, what happens is that when we reach a deep state of sleep, our brain cells essentially shrink to a size smaller than when we are awake, and that this allows cerebral spinal fluid to flow through spaces it was unable to flow through previously, thereby flushing out these metabolic wastes that have accumulated. Apparently the minute we wake up, these brain cells almost instantly blow up to their waking size, and the CSF is no longer able to circulate through these areas. When these mice brains reached a deep state of sleep, the circulation of CSF was ramped up substantially, and the theory is that this essentially flushes the brain of these toxins.
So if the theory is correct, depriving yourself of sleep allows metabolic toxins to build up in your brain. I'm not sure what the long term effect of this would be, but I do know there has been a long running suspicion of a link between alzheimers and sleep disorders, and the brain of alzheimers patients appear to have deposits of some of these proteins. This also would help explain in the immediate term why people feel kind of hazy and have trouble concentrating when they haven't gotten enough sleep, and why this worsens the longer you go without sleep, and why after a good long nights sleep you wake up feeling refreshed and mentally alert.