So after the Federation becomes this happy-perfect place, what then? Utopia is boring. Utopia leads to stagnation. How many times was that point made in TOS?
I think you have totally misinterpreted the point made in TOS. NONE of those societies were true Utopias. They were fictional, often computer controlled [and imposed] prisons under the guise of Utopia. The Federation is nothing like that and I think you should perhaps rewatch a few of those episodes.
Seconded. Those computer-controlled societies shown in TOS, in episodes like The Return of the Archons, A Taste of Armageddon, The Apple,
and even For the World Is Hollow and I Have Touched the Sky,
The only episode I can think of, right off the bat, that could arguably even remotely qualify as depicting a utopia under computer control is The Paradise Syndrome.
However, even if we acknowledge that as a valid example (though being under computer guardianship might be a somewhat better description), it still doesn't support the thesis that TOS depicted utopia as leading to stagnation. On the contrary, the actions of the Preservers were implicitly characterized as a Good Thing, and the Native American culture they preserved was depicted as healthy and harmonious, the malfunctioning obelisk and the fallout from the arrival of Kirok notwithstanding.
If we expand the definition to include situations such as that depicted in This Side of Paradise,
those happy colonists, living not under computer control but rather under the influence of the spores, were not
living in a utopia, either. They only thought
A true Utopia would not lead to stagnation. Hypothetically, with everyone able to pursue their own interests and better themselves unmolested, the potential for improvement and advancement is limitless.
As to whether a true utopia would lead to stagnation,
one could argue that stagnation is not an attribute of a perfect society, thus rendering the statement in question a tautology.
I actually only see the Federation continuing to absorb everything else around it. To be frank, I think this is one of the underlying themes of the whole franchise [that many people miss]: that all the 'bad guys' with their Authoritarian, militaristic states see the universal appeal of the Federation. At its core, its ideals appeal to all, it is simply a matter of time before the peoples of neighbouring states realize that.
However, I don't agree with this. For example, although, in the post-TNG time frame, DS9 depicted the Romulans cooperating with the Federation for the limited objective of defeating the Dominion, there was never any indication anywhere within canon continuity that the Romulan Empire would be absorbed by the Federation. Ditto even for the Klingon Empire. On the contrary, the only indications were that they would remain separate, even if allied, entities.