Section 31 wasn't in TNG. And I wouldn't say the utopia got undermined in TNG either. When you (fairly rarely) had corruption or villainy inside Starfleet, those people were always treated as rogues who were acting on their own, and were decisively defeated by the utopia. It isn't like in DS9 where the writers flirt with the idea that maybe the Federation can't work without a dark side; the TNG writers play the utopia straight.
One of the earliest books to look at this in an interesting way was John M. Ford's _How Much for Just the Planet?_ (depending on how one looks at it and one's tolerance for humour)