A lot of the time, they feel a bit unnecessary; one of the weaker parts of the narrative they're trying to enhance. Usually, it's the attempt at adding depth by using a combination of psychoanalytic metaphor and (more often than not) prophetic foresight which seems to fall a bit flat (with cunningly crafted exceptions, of course – take Twin Peaks, for example). As if, while attempting to add subtlety and depth, the writer has instead ended up making their narrative a bit obvious and shallow, or far too obscure to interpret.
All of this being said, I am quite fond of dream worlds. It's a niche belonging to portal fantasy, in which the portal is the simple act of falling asleep, and it has a history of producing classics. Alice in Wonderland, The Wizard of Oz (film!), and even more contemporary essential pieces of reading, like Neil Gaiman's Sandman, have their own dedicated realms of dreaming, and each is considered important.
Neil Gaiman is great to talk about here, because two of his principal works concern dreams. Namely, Sandman and American Gods, the former of which features a dream world (more of a universe, I know – but I'm using the word “world” broadly), and the latter of which features dream sequences. They're great examples of what I like about dream worlds (especially as they're developing in contemporary novels), and what I dislike about dream sequences.
The dreams in Gaiman's Sandman series have real world consequences. Dreams of all kinds can escape their world of dreaming, and Morpheus, lord of dreams, is often to be found wandering among the awake. By having his dream world able to often directly affect the waking world, Gaiman neatly avoids the most damning criticism posed at dream worlds: the classic “it was all a dream” ending, which undermines any threat or consequence developed during the narrative by resolving the dream world as never having existed outside the protagonist's sleeping mind. In Gaiman's Sandman universe, Morpheus's realm continues existing beyond sleep, and the narrative tension built in his stories is in how dreams might affect the waking world, and it works to beautiful effect.
Beyond this, Gaiman lets his imagination loose with Sandman, and the result is awesome to behold. Dream worlds are brilliant for letting the author really explore the limits of their creativity, and the best examples are where that creativity remains logically consistent. Nowhere in Sandman does anything contradict itself. Gaiman's universe, while imaginatively expansive and developed while it was written, remains whole and feels complete.
Comparatively, Gaiman's American Gods features dream sequences, and for a book that I love dearly, they often feel like a weakness in it. I think that, at least in the greater part of the book (the first two thirds), they suffer from their obscurity. They're obviously metaphorical (as much as any of the gods in American Gods can be considered, to some extent, as living metaphors), but they don't quite achieve the same mythical quality as the rest of what is quite a mythical book. As if: by adding another layer of obscurity to the interpretation that needs to be applied to the book to make it work, the meaning behind the dream sequences fails to surface in as quite as satisfactory way. They feel a bit inconsequential, too – at least, up until near the ending to the book, where Shadow is confronted by very different kinds of dreams which certainly bear on the plot.
Can the dream sequence be made to work? Of course, as much as it's possible for a dream world to fail. The above remains only a broad, sweeping opinion, with exceptions prevalent on each side of the argument. Dreams remain tricky to write and, all things considered, I'm happy with how dreams in fiction are being developed by writers. We're turning back to them, after a long period of absence.
You can see my own foray into dreams in my new book, Metronome. It features a dream world that I hope feels a little familiar, but fun to explore; consistent, yet colourful. And for all that I'm not a huge fan of psychoanalytic metaphor, it has a certain Jungian edge to it you might find interesting, should you find yourself curious enough to give it a read. At the very least, I can tell you that the ending doesn't involve the protagonist waking up and discovering that “it was all just a dream.” I think I would have been just as disappointed as you to have it end that way.