Who digs those Dungeons? Why do they attract so much Treasure/Danger?
No one.
That is the simple answer. Maybe not the fully correct answer. One has to argue first, what a dungeon really is.
I think we are far from the actual definition of a dungeon. Those damp cells somewhere beneath a castle or garrison, where the cries of the tortured can not be heard. These kind of dungeons are of course built by someone. Whoever built the castle, will inevitably build a dungeon somewhere.
But in our hobby, we have a broader sense of a dungeon. Let's have another look at what wikipedia has to say about that.
The word "dungeon" has come to be used broadly to describe any labyrinthine complex (castle, cave system, etc.) rather than a prison cell or torture chamber specifically.
And these kind of dungeons are not built by someone. No one goes around and thinks: Well, I should create some sort of complex, with puzzles and traps for no apparent reason other than to entertain an adventuring party.
Funnily enough, in video games this seems to be common practice. I often thought to myself, who goes to work in such a place, when they have to always solve some puzzle to open the door to the dining room. Best example would be the first Resident Evil. Oh, you want to go into that room. Well, too bad, play first the right song on the piano to get the key.
So, no. Dungeons in the definition of our hobby aren't dug, built or whatever.
There's two parts in a dungeon: The structure and the denizens.
The structure is rarely custom built to be a dungeon. It often served a different purpose in the first place: a temple, a cave system or a manor of a crazed vampire. Yes, someone has to build these (in the case of the caves, it would be nature itself). But they are not build as "dungeons", they are built to serve that specific purpose.
Only by the denizens it becomes a dungeon. A castle is just a castle. A cave system is just caves. You wouldn't consider a castle full of friendly people to be a dungeon. It is rather a settlement where you go shopping. But if you put a host of evil bandits in there, it suddenly becomes a dungeon. And the denizens also change the structure to fit their needs. Bandits will probably start erecting some traps to keep themselves save. Traps that wouldn't have been there before.
Denizens also bring treasure. Bandits do, what bandits do and gather gold and valuables from the unwary. Dragons have their hoard and many monsters are probably attracted to the shiny things. Adventurers themselves bring treasure too. Maybe another party ventured into the dungeon and failed. But their equipment remains, for you to take.
Dungeons are a living thing in itself. The structure is only there to give, well, structure. The denizens is what shapes the dungeon. And there could be multiple denizens in the same dungeon. Maybe at the same time, maybe at different times. When creating a new dungeon, that are the things you should think about. Who was in the dungeon? What was it's original purpose? Who is now in the dungeon and how did they make it their own? I have some tables to give you inspiration if you need it.