Dungeons preventing teleport, passwall, and other magical ways around or through walls have been a design cliche since Undermountain. It's been so endemic that Bryce Lynch gives special kudos to designers who don't fall for it. But what, exactly, are they afraid of?
The hypothetical cheater who uses spells to get to the last room of the dungeon must first find the last room of the dungeon. In a sprawling underground maze this is nearly impossible. If you're just using it to get through a locked door, that's the equivalent of a knock spell, and nobody legislates against those.
But let's say you've found the last room of the dungeon, either because it's bloody obvious (top of a tower, sealed chamber in the middle of the maze with the Gallstone of Four Parts) or because you have scried it out with clairvoyance, wizard eye or the like -- another tool type often suppressed by cautious adventure designers.
What do you think is going to happen when that teleporting or flying or dimension-dooring wizard gets there? A wizard, alone? Passwall and mass teleport are more of a problem (I don't allow them in my game). But without intelligence on the dungeon, again, they're just shots in the dark.
A better explanation of the obsession with fettering knowledge and movement spells lies in a clash of game design principles.
For incremental game design, everything is a matter of quantity, hit points and resources are worn down bit by bit, and a fair fight can be gauged.
Catastrophic design, though, allows for sudden winning moves, daylight frying the all-powerful vampire, a poisoned shirt killing Hercules. Balance here is non-linear, hard to judge. Discernment, avoidance, and preparation are more important than the toe-to-toe slog. Death is sudden, not gradual. Characters with a spell can kill a maze just like characters with a mirror can kill a basilisk.
The struggle between these two views, one "fair" and one "real," determines any given gaming experience. Another front in the war: turning undead vs. anti-turning medallions.
But even if you commit to the incremental way, "can't" is still the uglest word. Recently I made a try at fixing"you can't move." The obvious fix for "you can't teleport" is for the wizard's lair or whatever to be guarded by a chaotic teleportation zone that dumps you in a random location in the dungeon or even another plane of existence.
You can turn the undead? Fine, but the undead can also turn you. "Can," not "can't" if you please.
Appendix N - Unreal Literature
17 minutes ago