I believe that first there was an evolutionary purpose to sleep. That we evolved to remain quiet and somewhat paralyzed in the dark of night to stay safe from night predators. Through the safety of sleep, children survived to grow to adults and procreate. And during this sleep time, somehow the dream process evolved to function as a daily memory cleanup process because it was useful to adapting to our changing surroundings and threats.
So I agree with Crick and Mitchinson's theory that a dream is caused by a daily cleanup of our brain's neural network. Like an ongoing debugging and defragmentation of memory in a PC. A time to erase spurious memories, take in new data experienced that day and make connections if needed to older saved memories and so on. Freud and Jung had theories of why we dream but really I don't think they we're addressing a cause so much as imposing a man made interpretation that would serve to further there interests in developing the study of psychology at the time.
