There was no real reason to do it until nuclear weapons came along; it's scary how vulnerable DC is to a missile attack from sea. DC and Virginia are the only place you're not allowed to have a radar detector and if you go looking you could find any "stick a stock missile (say sidewinder) on a mobile platform" platform made by our allies parked on a vacant lot in that area.
1. The site of the US capital was a major point of North-South compromise in the early Republic. There was enough tension until 1860 about incorporating new territories, moving the capital would have been even more inciting
2. Until west coast cities grew further, the population mass of the US has for a long time been the east coast and the North East in particular.
3. Major investments in DC as a capital city from an infrastructure POV
4. The fact it was a “district” not part of any state made relocating harder.
5. The US Civil War massively expanded the Federal governments footprint in DC, making relocation harder. Subsequent wars, most importantly WW2 also spurned govt expansion is DC. Not just DC but all over MD and VA a lot of facilities are strategically located near DC.
6. Post civil war, republicans controlled the federal govt. Republicans changed from anti slavery party to pro NE business. Proximity to financial capital (NYC) mattered given (often corrupt) links between govt and expanding big businesses.
In other words, why ruin anywhere else?