One of my ideas is that before there were banks, those with money would build a strongroom to hold their treasure. But others broke into their strongroom and stole some of their treasure, so they got the idea to expand the strongroom into a dungeon, with several strongrooms, some empty rooms, secret doors, traps, and monsters added to the mix. And something to keep in mind is that monsters are also part of the treasure - bring back goblin ears to the local adventure guild to get a silver piece, hides have value, as do other parts. I remember a fun story where one of the local girls wanted to catch the eye of the local knight, so posed herself next to an Earth dragon - poor thing never had a chance. But the dragon was piled up in front of this peasant's home, and he wanted to know who was going to clean it up - and the knight dismissed it, saying it was the peasant's job. The peasant comes to a decision, grabs a knife and crawls into the wound on the dragon and cuts some of the lavender dragon meat and cooks it - and it tastes like liver. But he starts selling it - and when someone spills the beans, people start bragging how much they paid for their dragon meat. Peasant is raking in a fortune, but he's running out of sellable parts. When the knight hears about it, he comes to reclaim the dragon - but instead the peasant gets him to go hunt other dragons. Or go watch the anime Delicious in Dungeon - congrats, you're an orc but you're on the menu.