It's your world, so whatever fits with the logic of the world is fine (I want to make that my first point).
To my mind, a settlement like that can only occur on a natural and very lucrative trade route (as others have posted) or if some group with many resources has decided that the exploration of this dungeon is a high priority in terms of resources and length of commitment.
This group would have the resources to make this area viable. Perhaps the settlement's chief resource is a large (non-portable) artifact that produces a variety of foodstuffs in huge quantities (even with some variety, however, the inhabitants are always eager for outside food--even with 12 MREs, I bet soldiers want something different every now and then). Combine this with a few decanters of endless water, and you have the food supply for a viable settlement.
Why people would want to come there is another matter. It could be that this dungeon has a kind of legendary status among the Adventurer's Guild, and it is a kind of status symbol for people in the guild to live here. Perhaps the legends might explain why this dungeon would be interesting to some parties in the world--opponents or supporters of the mad god, religious groups, wizards seeking secrets--the groups that could be funding this are potentially numerous.
IN fact, finding out the secret agendas of the people funding it could become an adenture in itself. . .