Phoenix, Arizona? That's the first one that came to mind, but I'm sure there's others.
Besides, that's not why DC is where it is. Our early leaders, for better or worse, thought it was best for it to be an independent district. Making NYC (or any other predeveloped city) into an independent entity is much harder than just creating a new one.
Now that I’m looking for it, though, I cannot easily find evidence that that is true- I wonder why I was taught that?
(I can think of a handful of other factors that contribute to the US's weird capital city distribution, like real estate cost and the fact that many capitals were established after the telegram, making colocation in the largest city of each state less necessary.)
Are we talking about Brazil or the USA?
Here in Brazil, the capital of the state of São Paulo (also called São Paulo, the state and the city have the same name) is the largest city not only of the state, but also of the whole country; according to Wikipedia (https://en.wikipedia.org/wiki/List_of_largest_cities), it's one of the largest cities in the world. The same happens for the state of Rio de Janeiro, where I live; its capital, also called Rio de Janeiro (another case where the state and the city have the same name), and which is also the country's former capital, is once again the largest city of the state (and second largest of the country, and also one of the largest cities in the world). Go down the list of "largest cities in Brazil", and you will find several others which are the capital of their state. The capital of the state being the largest city in it is more of a rule than an exception.
New York is a great example. The state is large, historically rich but with very different interests. Albany is sort of a middle ground.
Massachusetts is different. The politics are such that Boston was always dominant.
Nationally, the slave states were agricultural dominated by manor like real estate barons. They were afraid of the northeast states and their traders and manufacturers and felt a capital closer to them would be less hostile to their interests.