Environmental hazards that make the city difficult to attack but also encourage the use of undead? Desecrated ground, rampant negative energy (with tomb-tainted soul likely being common between this and the undead presence), hungry undead whose draining abilities are useless against undead legions and who do not automatically attack them, strong thread of necromancy present in sorcery/native abilities, ancient pact for survival of the living against dark forces?
City has been sacked by the forces of light and positive energy in the past, conquered, occupied, and wound up corrupting them through the insidious influence of native magic and native belief, resulting in reformers whose methods grow steadily towards the necromantic while maintaining some idealism unrecognized by the next conqueror? As per Wee Jas, those who live in the city willingly give consent for their body to be used and consider it holy to serve after death, thus discouraging anyone whose motive is that necromancy involves desecration of the dead? Also as per Wee Jas, funeral customs could involve decorating the cleaned bones of skeletons who are raised, recording accomplishments and history and honoring with beauty ...
Perhaps there are some Deathless members of society, able to maintain dominance of force over negative-energy-infused groups while quite able to survive positive energy to preserve culture should a Sunbomb be unleashed.
I'm meaning to shy away from traditional D&D trope of "Necromancy is always evil". In fact, i'm trying to go for
Gray and Gray morality here, and towards "No Magic is Evil, Only People Are Evil" kind of vibe.
Environmental hazards that encourage the use of Undead could be a good one. Poor soil, harsh weather... The Undead have no problem plowing away at hard, semi-frozen ground 24/7, while the living might.
I'm thinking the settlement may have began with a single necromancer that had in his vision that Necromancy wasn't actually evil, and wanted to show the entire world that was the case. After being shunned from just about everywhere, he eventually decided to gather like-minded individuals and pursue his dream. He travelled far and wide acquiring apprentices, farmers and just about anyone he could get into his dream, using his considerable wealth - acquired when he was an adventurer.
Eventually, he found a secluded enough spot, far away to the North, in harsh inhospitable lands, and went about realizing his vision. Thanks to the wonders of what essentially amount to perfect untirable slave labor, his settlement quickly grew to a small hamlet, later reinforced by a small fort, and kind of grew from there...
This might be a good enough idea? Or is it too "mundane"? Eventually i'd like this to grow into at least a moderate-size metropolis with a bustling industry.
I'm not sure whether they actively try to hide the fact they use Necromancy for just about anything, or they just don't care and defend against the eventual military incursion into their land.
EDIT: Their industry would be very, very strong because of the fact they have near limitless free labor. But i'm thinking about creating an even stronger industry-focus city of Dwarven thinkerers, who use constructs instead of undead, and are thus much more generally accepted worldwide. To compete with them.