I've been a GM for a long time, and a few things I've learned are that dungeons should feel authentic, be hand-crafted with a purpose in mind, and ferry between encounters.
Make Dungeons Authentic
Dungeons aren't usually built by bad guys for bad guys to lurk in and then raid the surroundings from, and even if they are you've got some things to consider. Caves, for instance, will likely be expanded by hand or with tools/machinery (based on tech and capabilities of the inhabitants) in order to have more storage, some security measures, and dwelling spaces. Normal caves aren't all that great, since they tend to be somewhat wet and somewhat hazardous to maneuver in, so they'll have pathways and such worn or intentionally cut through them, and anything in them will be protected from the humidity somehow, unless it's fine just sitting there (i.e. no iron stuff sitting in plain sight unless it's rusting over).
I like to use four basic requirements for my dungeons (which also applies nicely to pretty much every other structure for adventures): functionality, storage, needs, security.
Every building has a purpose. Even if it's a monument, it's meant for something. Who built the dungeon? Why? Does it do something that the current inhabitants might not like, and have they tried to suppress this?
For instance, if goblins move into a human castle, the will likely deface the monuments, because they really don't care about the former human inhabitants. Most dungeons have a function ostensibly of being a defensive or offensive position, so anything not on a hill will be concealed, and anything on a hill will be fortified. Quarries, on the other hand, may be lightly fortified, especially if the ores being mined are valuable, or they're in a dangerous region, but are unlikely to be in a strategically advantageous position.
A good example for this would be a medieval church; they served obviously as a symbol of faith and a meeting place for the locals, so they're made of long-lasting stone and built tall so they can be seen. Many also have bell towers of various sorts, which can be used for communication of important events, holidays, or emergencies. You have a sanctuary for meeting, various clerical rooms (depending on time, local customs, and whether the priest lived in the church or off-site), and a spire in pretty much every church worth its salt.
I know of absolutely no business that does not keep its supplies on site. No military base has to go out to grab ammunition on a daily basis. The church in my example above likely has storage for candles, clergyman's garments, and various materials used in worship and spiritual services.
Any major (and even most minor) sites prior to mass transit will have storage for food and water. In the modern day, water's been offset by plumbing, so we usually don't store it except in central places, but we usually can find some food stored pretty much everywhere, even if it's just in a worker's cubicle for a mid-day snack.
Also consider weapons and the like. A creature's lair will likely have little if any storage, even the least sophisticated humanoids will have some storage for necessities, and hoarders (in mind or culture) like dragons or dwarves will build massive vaults, burrows, and stockpiles for goods.
Every once in a while, when you're building a place, a pressing need comes up. Medieval castles were often built of wood, not because it was superior but because it was there. If there are no quarries around you can bet that large structures will be made from brick rather than stone. Rough terrain may even mean that fortifications for a provincial region fall outside the main economic areas, since there's no good way to build effective fortifications with the resources available.
Note that when I say needs I'm referring to situational needs, rather than inhabitants' needs. Look at modern buildings that are often built to be earthquake/wind resistant. Even dungeons in caves will have supports and the like because they're supposed to stay standing rather than burying their inhabitants.
Finally, security is a major part of many dungeons. Consider things that the inhabitants would find reasonable. It's entirely possible that the door to the treasure vault is trapped, but you won't find a trap at the front gate or whatever the inhabitants use most, because it has a way too likely chance of accidentally killing the users.
Security rather typically focuses on denying entry. Rope bridges across chasms work just as well as a gate against many threats, so long as you aren't accidentally trapping yourself in view of archers or mages. Heavy doors are preferred to a flimsy door with a trap; adventurers are actually one of the least of the worries of many people.
Likewise, any fortified location will likely have some sort of concern for escape as well as denying entry. You want a bolt-hole for when the bad guys come, and the bad guys view the good guys as bad guys. Even if it's as simple as a safe room to hide in until you make a stealthy (or bloody) egress, dungeons likely have somewhere to hide.
Security measure that actively harm are rare if you want a "realistic" feeling dungeon, though alarms and the like may be relatively common should players do something they aren't supposed to.
Dungeons With A Purpose
More so than the architectural design of the dungeon, each dungeon should have a purpose for the players. No dungeon in a hack-and-slash campaign should exist simply to be explored; although this is certainly a viable option for exploration oriented campaigns, you just don't deliver the purpose. I like to think of each dungeon as filling separate categories of narrative and game fulfillment.
Each dungeon should have some pop to it, some zest. 13th Age does this very well, with the idea that each dungeon not only had a purpose behind its creation but also has a purpose for being placed into the game.
I like each dungeon to hold either a secret, a clue, or an adversary. Sometimes I mix and match these, but especially with the more hidden ones I try to keep each dungeon relatively clear and concise. I don't make a dungeon longer than it has to be, making sure that every element in my dungeon leads to the conclusion, rather than simply having a number of individual sections that may or may not be important and are just loosely collated. Believe it or not, this is actually something that's easy to forget to do; I've had players look at me like I'm crazy after some sessions.
The important thing is that after completing a dungeon, you're immediately on another story point. You may then go to the inn and recuperate, but there's no "well, what do we do next?" going on; using dungeons with a point keeps your games "high-impact" and won't let them slow down to the point where they can dwindle and die.
Game fulfillment comes in two forms: reward and achievement. You always want to remember that players are not merely rewarded for playing with a new +3 Broadsword, but rather that many actually enjoy being able to actively participate and show off their abilities. I include skill rolls often, especially ones where a specific character is involved. This has the added upside of forcing my more chaotic evil parties to cooperate a little, since eventually my players realize that they can't just vengeance-shank each other as soon as nobody's looking.
I try to stagger rewards through dungeons. I like my players to see all my prepared content, so I reward them a little for each room, giving awards custom tuned to each character throughout the course of the dungeon, but only one or two at a time so that there's no sudden glut. Everyone gets a little spotlight. I also like to do session spotlighting, so big things may go to a specific character now and again at the "end" of a dungeon to give a player who either did spectacularly well or whose randomly determined turn it is a little boost.
Ferry Between Encounters
Dungeons have a flow and a purpose in swords and sorcery. Where there's one adventuring party there's another, and I like to use dungeons as little adventurer meeting grounds, graveyards, and prisons where I can drop NPC's in to guide the plot.
What this means for short-term design is that I try to always include little hints and clues about what awaits in the next room, or if that's not appropriate I at least give the players a reason to move into the next room through the plot. For instance, if there's a missing person the players will typically keep going until they find them.
For long-term design, however, I make sure that there's a little something in each dungeon that indicates where the players can go next. I don't force the issue, but I'll make sure to mention that the wonderful +3 Rapier the Ranger found has a partner, forged by master duelists, and that the other is somewhere accessible to them. Of course, this isn't for everyone, but since I don't like to force my players into my plot lines I drop lots of little hints and teases into dungeons to give them a long-term goal for future adventuring.
This sounds a lot like it's a plot point, but it's not. My groups have a tendency to kill, on accident or on purpose, many NPC's, and I like to let them do so. Having another little lead for them means that I can gather up the plot again before they run out of things to do and get bored with the game, even if the next session is little more than a road-trip followed by a brawl.
Don't make Skyrim dungeons. Make dungeons that feel living and vibrant, and make sense in the world. Populate each dungeon so that there are encounters that advance the story and plot, and have a significant role for the narrative. Give enough reasons for the players to keep interest in any particular dungeon, and also give them a little glimpse of a future dungeon or adventure to keep them hungry for more.