Why the audience will yell "CHEAT" at the author for doing this.
The main reason audiences usually hate this one boils down to one word: Stakes. In order to be interesting, a story needs to have stakes, something at risk or something that changes. Dream stories are usually the exact opposite of that: Nothing was at stake, and nothing was going to change, and, in effect, the author is yelling "Gotcha!" at the audience.
The "it was a dream" twist is often considered the ultimate Writer Cop Out for this reason. Tricking the audience into thinking something was at stake only to reveal at the very end that it was, narratively, a complete waste of time and doesn't affect the status quo.
Methods of avoiding the audience shouting "CHEAT"There are a few reasons to use All Just a Dream plot that won't lead to people shouting "CHEAT" at the author.
- Character Development, showing us hidden anxieties, hopes, or other personality traits that drive the dreamer.
- In a serial, the dreamer makes a major decision as the result of the dream, and that has consequences for the rest of the show.
- A setup/justification for a Bizarro Episode.
- A setup/justification for a full episode Out-of-Genre Experience. (Note that this one may work better if it's known going in that it's a dream, but then you have the Dream Episode, which is a separate trope.)
- A Dream Walker / Dream Weaver / Dream Stealer plot.
Note that setups that explain beforehand that the dream in question is a dream, which is a different trope known as the Dream Episode, also cut down on people yelling, "CHEAT". Also, acknowledging that Real Dreams Are Weirder than the other kind helps a lot.