Dungeons are arguably at the heart of any fantasy roleplaying game. They are generally the hub of action and adventure, where the most fearsome foes lurk and the most valuable treasures are unearthed.
But dungeons should be seen as much more than places where monsters live and traps are built. They are opportunities to build narrative and develop characters. Players should emerge from a dungeon having learnt valuable lessons and obtained new goals. Dungeons are powerful tools in a game and you should use them to your advantage.
Dungeons should change characters
Say a group of delvers has to go and rid the Waterdeep mines of an undead scourge. They might expect a couple of fights with zombies and skeletons, a few puzzles, a boss and some treasure. This is all fine and dandy, but it doesn't sound all that memorable. If they emerge 1000gp richer and that's it then they're exactly the same as they are when they went in, but with a bit more cash and more experience points. I argue that every dungeon should have an impact on the party. Perhaps one of the delvers is cursed to feed on the flesh of the living every full moon as a result of a trap, or one is impregnated with a demon child that will burst out in a matter of days. In these examples, characters will emerge from a dungeon different from when they went in and so the game has taken a step forward and evolved beyond just having more money or xp.
Complications create opportunities
It's likely that the reason the delvers went into the dungeon in the first place was because there was an overarching quest they were trying to complete. A change that creates complications, like the cursed player, forms a new opportunity for adventure and offers a less railroaded narrative. Now it comes down to whether they complete the quest now, or whether they venture into the Ironstorm Foothills to search for a cure. This can end up having a chain effect where the complication is removed by venturing into another dungeon, but another one or two are added when they emerge. What began as a set adventure has now turned into one that is spontaneous but that the GM can plan for. After all, she's the one making the complications.
Dungeons can develop character
Delvers don't necessarily have to emerge from dungeons with new personal quests. Their personalities should be tested and sometimes altered throughout the dungeon through puzzles, encounters and traps. Obviously it's not a good idea to go around completely changing characters, because that would be no fun, but including parts where it's optional for a character to tweak their personality will serve to create great roleplaying opportunities. For example, in my current campaign the party has recently found a gauntlet that can turn the wearer evil for a limited amount of time. It's optional whether they use it or not, but if someone did then it would not only change them, it would present a new roleplaying opportunity and a chance to expand that person's character.
So don't think of dungeons as just a series of rooms full of monsters and traps. They are tools that can develop the adventure, give the players some free will and alter the characters in a meaningful way.