That is a case where Star Trek forces us into ethical dilemmas.
The attempted genocide of the Founders is one of those dilemmas. The Dominion and the Founders are hardly an innocent party here. They have engaged in genocide themselves, as well as tyranny. They undermine other powers and start a war with the Federation and their allies. And there's no doubt what their goals are. The complete subjugation of the Alpha Quadrant, and anyone who tries to stop them will be wiped out. The Dominion has absolutely no qualms about committing genocide. And worse, they don't care. Weyoun casually talks about eradicating Earth with about as much emotion as I would talking about baking an apple pie.
So in comes Section 31 and the Founder plague they created to wipe out the Founders. The question is, how far would you go to protect the Federation from the Dominion? You're literally facing a question of your very existence and way of life if the Dominion wins the war. In general, the Federation would be horrified at the prospect of committing genocide, or even thinking about it. But now they are facing the very real prospect of complete and utter defeat to an enemy whose goal is utter domination and if necessary, destruction, with as much concern as we would have stepping on a blade of grass.
So, is Section 31 justified? I don't think it's so black and white. If those are the choices you face, what do you do? There are no easy answers.