Take note, writers. There are few things you could do that convince me more of your hackitude than having a cop-out ending where everything is revealed as "just a dream." From where I sit, it completely guts the story on an emotional level because then nothing that happened in the movie "mattered." There were no rules for anything that happened. Plus, it's often a cheap out for a writer trying to surprise the audience.
Yes, The Wizard of Oz reveals that all of Dorothy's adventure in Oz was a dream. But that was 70 years ago, and done that way because the studio feared the audience wouldn't accept the fantasy any other way. If the movie was made today with that ending, it would be more critically derided than the endings of any M. Night movie post-Unbreakable.
And to tell you the truth, I'm not terribly fond of dream sequences within the film either. Slasher horrors tend to be the worst here (excluding the Nightmare on Elm Street series, where it has a context) because scary dreams are an easy way to get in some gore and perhaps even rough up or kill the main character without having to make it count or affect the plot. I've read many a horror film where the writer tried to compensate a dead Act Two by tossing in a few scary dreams in order to up the violence without actually advancing anything in the story.
Aside from violence, fantasy sex scenes also tend to be popular among writers for similar reasons. It's a good way to get a prudish female character gratuitously naked without compromising her character. Either that, or it's done to get your virginal male lead into a threesome without instantly resolving the main plot of him trying to get laid for the first time. In any event, the cheap trick is usually transparent from a mile off.
The worst use of a dream sequence that I ever read had to be a script I read for Big Deal Agency a few years back. I probably am legally bound from even giving the premise, but the whole story was built around a totally ludicrous conceit. It was ridiculous on the level of the world suddenly switching to a swatch-based economy. The most absurd thing was that the writer treated this premise with the utmost seriousness, as if the events in the film were even remotely plausible. Well, in my coverage I pointed out just how utterly unbelievable the premise was and how the way the writer chose to introduce that premise only enhanced its implausibility.
About a month later, the script was resubmitted and it again landed on my desk. Comparison coverage is always a great gig because usually all you have to do is read the script and if there aren't any major changes, just affirm your original notes. Most of the time, you'll only have to tweak your original synopsis and notes, getting the same pay for a fraction of the work.
By p. 30, I had yet to notice anything different, including the implausible premise and inciting incident. Ditto p. 60, and then p. 90. With only five pages left in the script, I noticed nothing different, and was perplexed that the writer had resubmitted the same draft with all the aforementioned weaknesses. And then, right at the very end a new scene emerged. The main character wakes up on a bus, right back at the point we last saw them on p. 12. Almost everything in the movie was a dream. That was their out for why things didn't make sense. You could almost hear them say, "See? Now it doesn't HAVE to make sense! It was all a dream!"
All this did was made me think the writer was even more of a hack than I had originally given them credit for. It's already difficult to get an audience to sympathize with a fictional character within the construct of a fictional story. Once the script adds another layer of fiction within that fiction, it takes the film to a whole new level of unreality. Often the audience says, "Well if none of this matters, why should I care?"
At the start of the film, the creators are essentially entering into a contract with the audience. The first act sets the tone and establishes the boundaries of that particular film. Basically, it shows the audience what's in-bounds and makes an implicit promise not to cheat by stepping outside those bounds. "It was all a dream" breaks that contract with the audience. It's not clever - it's a cheat, it's lazy, and good writers don't have to resort to it.