When one looks at the neurology of REM sleep, it is hard not to reach the conclusion that dreams are a form of "inverse anxious mind-wandering". As in the neurology of mind-wandering is activated, however the brain is (surprisingly) in an extremely relaxed state.
Norepinephrine (the fight or flight neurotransmitter) levels are 80% below base waking levels (Norepinephrine spikes when you are in a stressful situation), and the amygdala (threat detection) is inactive.
When we are awake and performing anxious mind-wandering (with Norepinephrine levels raised and our amygdala active), our mind-wandering has a focus/direction. It imagines the worst and this encourages us to take avoidant action; for example, you might wish to bring something difficult up with a friend, however you brain will imagine all the ways that it can go wrong so you avoid the potential confrontation. From a survival point of view, it is pretty useful for the brain to have a bias towards avoidance when awake.
I posit that during dreaming, the brain creates situations in which it would be wise to be unavoidant. However, typically, despite the situation we imagine quite clearly calling for unavoidant behaviour, we take avoidant behaviour. This is because our emotional/episodic memory areas of the brain are activated during REM sleep, and we automatically take the anxious behaviour we have been "trained" to take (our neuroses).
This, in my eyes, is the function of dreaming. To highlight our neuroses/unconscious redundant anxieties. For this reason, controlling the content of your dreams would remove their primary function.
I wrote a paper on this topic which contains several examples of dreams that fit this structure. (I'm afraid I do not have the time to type an example out now.)
It can be read here: https://psyarxiv.com/k6trz
It was previously discussed on HN here: https://news.ycombinator.com/item?id=19143590