I'm taking inspiration from the title of another thread.
It's generally acknowledged that things like castles and medieval fortifications as a whole are less than useful in a world with D&D style magic in it.
They still have some use. They still prevent attacks by "mundanes". Adding things like "hoardings" helps repel flying creatures. Fireballs don't do much damage to stone walls. Of course, invisibility, impersonating and mobility magic bypass walls in differing ways.
And even these aren't infallible. Passwords slow (but do not stop) impersonations. Intelligence-gathering is necessary to bypass these, or a long-term infiltration so you get told the password along with the real guards. Invisibility can be stopped by closing doors or hanging transparent curtains all over the place. There's not much fix for Dimension Door that doesn't involve magic, but you do need a mage of 7th-level+ to pull this off... and they need to either be higher-level or do it multiple times (or shrink companions, etc) to take an army with them. A single mage isn't
usually that dangerous, unless they've got a
lot of levels, and even an infiltrating adventuring party is going to face issues.
D&D 4e balanced magic compared to mundane, so walls work better there. Invisibility is easy to perceive because you don't get a bonus to Stealth (it's hide in plain sight) and see transparent curtains above. Passwall is a ritual with a long casting time, so you need some way of hiding what you're doing. (The Greater Invisibility spell only lasts 5 minutes at best, requires at least a minor action to use each turn... and the ritual takes more than 5 minutes to cast. There's a Traveler's Camouflage ritual that would let you perform this invisibly, but even then I'm pretty sure the fold in space will appear. But by then it might be too late.)
IMO, if PCs or NPCs work to prove that the security is not infallible, I think it's okay. I don't think D&D magic is so over the top (most of the time) that you can automatically bypass even mundane security. A castle is a series of encounters, same with a thieves' guild or other such target.
Similarly, feudal style social stratification would fall by the wayside very quickly when some talented kid off the farm could develop Sorcerous abilities out of nowhere.
I disagree. You'd just have more power groups. I discussed that in this thread:
http://www.enworld.org/forum/showthread.php?355544-What-is-feudalism-medieval-to-you - specifically see the "confessor" to go along with the court mage.
The power that real-life nobles led was in terms of wealth and military. You had land, you had money and food, you had troops supported by said money and food.
Of course, you also have people who can alter reality, in at least two flavors... but they're kind of rare. While a wizard might be more powerful than a fighter, they're not going to be stronger than a dozen fighters. Not unless they start abusing Simulacrum. A wizard with a bunch of simulacra is probably as powerful as a lord with lots of troops. A mage might create a tower and call himself the local lord, and when he dies his children might take over, or have a lot less talent and sell their skills, putting an end to that short-live noble line.
Wizards have their own vulnerabilities (at least those that aren't really high-level). They require components in most editions of D&D and ritual components in 4e, plus spellbooks and/or scrolls and/or implements. Even a basic orb costs quite a few gold pieces. Wizards either need to create guilds or attach themselves to a powerful lord. Guilds are targets, but then they're not going to roll over and play dead. The best guilds are secret. In some settings (such as Dark Sun) these vulnerabilities are extreme. You could get killed just trying to buy a 1st-level scroll (or shaken down by a templar).
Consider a world where the "Will of god" can be known with certainty, and independently verified from anywhere on the continent.
The only way to know the "will of a god" is to use magic, either pray (a divination-type spell) to get a message, or literally visit the god. And even then, you know the will of one god, not their rival or enemy. You might not even be talking directly to the god, but to their angels, devils, or other servants. If the god is someone like Cyric or Zeus,
they might not know their own wills.
Consider a justice system where the innocence or guilt of an accused criminal can be verified with 100% certainty, using the right magics.
Sometimes in real life a noble may have murdered someone in public and go a slap on the wrist. Indeed, nobles
were the local law. Power means a lot. I hardly see how 100% lie detection helps matters. Duke Jerry is not going to convict himself. You could even bribe the lie-detector! Also, memory-altering magic could result in a character believing they're telling the truth that they didn't hire an assassin to kill a rival. (Magic is also great for establishing alibis, whether having an imposter or just mass-charming witnesses.) Order of the Stick played with this trope; an evil aristocrat had an extraordinary ability through a prestige class that made him immune to truth-sensing magic.
I figure a smart villain would act like a paranoid organized crime figure. A mobster might never discuss business over a phone, and never commit a crime in person. A villain might pass all messages through subordinates, talking to them in a sound-proof room. (Even if they're scryed upon, unless the scryer can read lips...)
Consider a world where trade can occur over vast distances in the blink of an eye, thanks to spells like Itemize/Shrink Item and Teleport.
This one is pretty edition-dependent. You would have issues in 4e, where you need a portal network, and these are expensive and heavily-guarded because they're creating a point of vulnerability. (4e portals specifically get found in major cities, temples and mage guilds or towers, not great places to try to invade. They're also small, and should be surrounded by large numbers of guards.) It's expensive even to
use the ritual, so only expensive, high-value and (hopefully) low mass items get sold.
Consider a world where pretty much every national border can be bypassed by anyone who can afford the Wizard's services, where an enemy can use things like Teleport Circle to drop troops directly into your capital city, or even your bedroom.
That's a very high-level spell. Most settings just don't have that many high-level casters. Teleportation Circle (and its psionic Wormhole versions) are specifically designed to do this though. In 4e, you can do this too, at 28th-level, maybe a couple of levels lower with the right feat, and even then you're pouring out of a 10 foot circle, plus the portal lasts a limited period of time. You can't teleport armies. You
can invent the medieval equivalent of paratroopers though. (There's a lot of strategic use of invading a strategic castle that was holding supplies for enemy forces. Now you've got their food, and can sally forth to attack their rear and burn their tents. It's not an I win button though)