I just always assumed the Constitutions were phased out as the Excelsior and Constellation classes were coming in line. With the new classes being built, there was no point in repairing a heavily damaged Constitution when those resources could be better used building a new ship. With the Miranda classes, they were smaller vessels, simple to build and easily modifiable, so they continued to be manufactured and upgraded.
Personally I liked their use in the TNG/DS9 era. It showed that the Federation was getting so big, that they had to keep the once front line ships in service as cargo ships, and routine patrol ships instead of the exploration vessels they were. During the Dominion War their presence showed how desperate the Federation was to put every hull they could on the front lines, even if those poor Mirandas didn't stand a chance against the Jem'Hadar.