Finally, a probably-controversial opinion:
There’s a tendency to picture Section 31 as always, in every single action it ever takes, to be evil and to the detriment of the Federation. There’s an opposite tendency, mostly in certain quarters of fandom, to portray it as the secret unsung heroes who are actually saving the Federation all day and probably having great 007 adventures doing it. Both of these takes are silly.
A government arm — and however off the books and disavowed it is by the 24th century, it is a government arm — isn’t going to last for over 200 years if it never gets anything right and always proves to be against its own side’s values. On the other hand, where there’s smoke, there’s fire. S31 does awful stuff—whatever else it may also do, that we never get to hear about.
It seems more than likely to me that Section 31 runs all sorts of operations all the time, ugly and beneficial, the only connection being that they’re all deep, deep black No Eyes Only actions. Starfleet Intelligence is the public, accountable intelligence service. S31 is (by the 24th century) the disavowed Impossible Missions Force — and also, yes, the KGB. Starfleet proper doesn’t like S31, but at the highest echelons, it absolutely retains it as a resource.
If this sounds like a defense of Section 31, it’s not; genocide is genocide, and unaccountable power run amok is unaccountable power run amok. I just don’t buy that Section 31 is only, ever bad (or good).