Once upon a time Gygaxian Unnaturalism was the default assumption for DnD. In it, the world essentially plays favorites between PCs and monsters (unfortunately, the favorites are not you) and logic is more or less thrown out the window as far as stocking dungeons. Monsters rarely fight among themselves and will instead team up in odd combinations to fight you, doors refuse to open for you but swing easily for them, rooms are randomly arranged and dressed. In short, the dungeon is a bizarre place more the testing ground of a mad wizard than a realistic ecology simulator.
In limited doses, this may make sense. After all, there probably are some mad wizards out there crafting strange dungeons with little rhyme or reason. But for an entire campaign to operate this way chafes the sensibilities of those who expect their game world to make a little more sense. Here are three explanations why an entire campaign world might operate under a state of Gygaxian Unnaturalism. Players and characters may not be aware of these reasons but discovering them can be a fun campaign arc.

The Live Earth Theory:
Back in the era of Spelljammer, there was a random chance for each newly discovered world to be a “live world”. These looked like standard worlds but were in fact a single massive living entity. Live worlds could easily play host to Gygaxian Unnaturalism. In this case monsters aren’t actually monsters but are instead the immune system of the planet so they’re able to simply spawn from the ground, open stuck doors, detect intruders through walls, and other feats, and they rarely fight with each other unless tricked somehow. Some dungeons aren’t dungeons, but are instead natural channels and pathways within the body of the living planet. Monsters are found here to ward off infection and keep out dangerous outside organisms (In short, you’re adventuring in the ear canal or nostril of the planet. Those piercers and oozes? You know what they are). In addition, irritations or breaks in the surface of the planet are likely to cause immune responses, so settlements and farmland are likely to be attacked by monsters in an attempt to raze them to the ground and remove the “infection”, and man made dungeons are constantly in danger of being overrun from within by monsters.
In this setting most PC races are probably “fallen children” of the planet. Perhaps a few changelings are born that feel the pull of their ancestral duties more closely than others and who secretly seek to undermine their communities from within.
In theory, Gygaxian Unnaturalism could be put to rest on this type of world by essentially stressing the planet’s immune system so much that it becomes suppressed, but this leaves the planet open to the dangers the immune system was fighting against and may even lead to the death of the planet. This would almost certainly lead to a massive ecological collapse and an entire planet’s death would pull legions of undead from the negative plane to feed.

The Lovecraftian Unnaturalism Theory:
One of the outer gods of the Lovecraft mythos (actually the creation of Clark Ashton Smith) could be responsible for a world of Gygaxian Unnaturalism. Abhoth, The Source of Uncleanliness is a massive pool of offal and ooze which constantly spawns abominations of every description. Imagine a world in which Abhoth sits at the core spawning endlessly, his children tunneling upwards, building complexes which make sense only to their own twisted Outre minds. As his children spread and worship, Abhoth’s malign influence grows, and the very walls become aware, guiding his children and hindering those from the outside world.
This is a more standard dungeon crawl, but likely focused on some Lovecraftian themes, such as madness and the inevitability of defeat. It’s also an excellent campaign in which to feature some of the more uncommonly used mechanics such as monsters that require magic weapons or certain metals or elements to permanently kill, and long term damage in the form of madness, drain, or disabilities.
Thanks to the nature of Abhoth, monsters in this campaign are all unique, even if their stat blocks are similar, so mixing groups of enemies more than usual, tweaking abilities and adding extras (a goblin with acid spit riding on an ogre-slug centaur) can add some fun “Jim Henson-esque” moments.
The eventual goal of the campaign might be to slay Abhoth and put an end to his spawn, but this might open the way to other horrors, so perhaps the end goal is just to suppress them, or perhaps it’s to capture and bring back a sample for study (and then stop the mini-Abhoth that is forming underneath the wizard’s study after a drop or two snuck away, because of course it did).

The Divine Judgment Theory:
There are plenty of Divines that have criteria to get into their particular slice of heaven, and there are times that you just barely measure up short. Maybe you were the penultimate berserker, but in the heat of battle, you tripped on someone’s guts and hit your head on a rock. If a god is merciful, they might give you a second shot and have you reincarnated. If you mess that one up too, well eventually they make it easy for you. They put you in a simulated world where all the non-adventuring jobs are taken by simulacra made of divine energy, and the world is set up to push you toward success or failure. You and those like you reincarnate here until you decisively succeed or fail.
This world is all about adventuring to the exclusivity of everything else, so no one expects dungeons to have any sort of logic to them (in fact, they would be confused if you thought to ask them) instead it’s more about opportunities for you to prove yourself worthy through your bravery, cunning, ferocity, or whatever else the gods value.
Interestingly, the attempt to keep reincarnated souls focused on adventure (and not have them accidentally become a baker for example) leads to bits of strangeness as well. Newly reincarnated adventures appear fully formed into the world with their base gear, there are never job openings among non-adventurers (even after a goblin raid decimates the town), sages never study the nature of the universe, etc.
In addition, the gods have better things to do than monitor this pocket universe, so they assign lesser divine beings to do it. This leads to odd glitches here and there, like dungeon walls that change when you look away from them, or an innkeeper who is replaced by his twin brother you’ve never heard about and who occasionally remembers conversations you had with his brother.
While there is no way to end the Gygaxian Unnaturalism of a divine prison, you can get out by succeeding or failing spectacularly. Die gloriously charging a dragon or sniveling for mercy from kobolds and you’re not coming back. However, unlike other options, discovering the nature of the prison makes the world more dangerous. Not only does it forfeit any win or loss you might make this time around (the gods claim it has something to do with faith), if you go shooting off your mouth and cluing in others, you’re likely to draw the attention of the overseers who will attempt to “reset” you with maximum prejudice, and barring that will turn the entire world against you, in a sort of living zombie apocalypse. Good luck.