The brain also "resets" during sleep. As part of that process, it shrinks substantially.
Aa you do stuff during the day, synapses swell as they see repetitive use of the same pathways. This reinforces those ideas or actions, crowding out other things. In order to restore short term memory formation and the ability to learn new things, your brain has to reset at night.
There's also interesting research on two proteins, amyloid and tau, that accumulate faster when people are sleep deprived. They are both associated with Alzheimer's.
One of them rapidly resolves when you get caught up on sleep again. The other doesn't.
http://blogs.discovermagazine.com/neuroskeptic/2015/06/08/br...
Brain expansion (not contraction) overnight is unexplained, but may be due to fluid retention. That definitely affects the spine - causing us to be slightly taller and less flexible in the morning.
https://neurosciencenews.com/sleep-brain-reset-6047/
Sleep Shrinks the Brain--and That's a Good Thing
Without a nighttime reset, synapses could burn out like an outlet with too many appliances plugged in
https://www.scientificamerican.com/article/sleep-shrinks-the...
The sleeping and the anesthetized mice had a 60% increase in the volume of fluid, apparently because brain cells actually shrink to allow more space in the channels. When the researchers woke the mice up, the flow of fluid into the brain abruptly slowed.
http://m.nautil.us/blog/sleep-when-brain-cells-shrink--neuro...