A PC can hire hirelings to guard the dungeon, add traps, bind exotic guardians such as elementalsgolems, and even capture and free "monsters" if they wanted to.
- ItsIt's the PCs home base and has something worth protecting inside. Perhaps the PCs have valuables they don't routinely carry everywhere because they are no longer murderhobosmurderhobos. So they live in a castle. They hire guards and install traps to protect the most sensitive areas. You have a complete Dungeon in the D&D sense with adversaries to stop looters/adventurers, and treasure that the PCs just view as their home.
- The PCs have something they cannot destroy and need to make sure it never falls into the wrong hands, so they build a Dungeon deliberately to make sure its protected. Imagine the PCs have an artifact that they cannot figure out how to destroy and it is too dangerous for them to use. They might lock it in an underground room, surround it with traps, seal that room, leave traps through the path add, bind magical guardians along the path permanently, and then seal the final entrance. They want to make it hasas hard to get as possible, but they may need to be able to leave open the possibility of retrieving themselves later. You have a D&D Style Dungeon.
- Similar to the last one, perhaps it is a tomb for a fallen comrade that was buried with his valuable gear.
- Perhaps it started as something else and happenstance effectively made it a dungeon. Perhaps the party Wizard has a major experiment go wrong in his tower and the place becomes overrun with demons or something similar. The Wizard needs to flee, regather his party, and go through the dungeon he accidentally created just to get his stuff back.
Those, and more, are all reasons that a PC might intentionally or semi-accidentally make a dungeon. They are a little outside the way D&D is normally played with the party as murderhobos...err...wandering adventurers. But there are rules that cover at least the basics of what you need to do these things with costs for keeps and similar buildings, costs for laborers, rules for traps, and PC accessible spells allowing certain types of guardians such as golems to be created and bound.