Isn't the latest thought that it's to take the brain down for maintenance to flush out debris from processing done during the day? (citation needed)
I believe the brain actually shrinks slightly and channels expand to aid in the flushing.
Anectdata: note how when you're really tired you can't think clearly? Also, how (apparently) if one goes without sleep for too long then the brain suffers irreparable damage.