Semantics. Section 31 sees themselves as being part of the Federation's founding charter. Legality based on technicalities is not true legality if it wouldn't hold up in an open trial.
"Protect against threats" is the kind of vague justification that excuses fascism. If you need to manipulate other nations' politics through espionage and subversion to protect your country, it doesn't deserve to be protected. Make no mistake, section 31 is a fascist organization has rationalized itself into a corner where it can do no wrong, and is justified in assassination and even genocide so long as it can claim it was 'Protecting the Federation'.
A nation that deserves to be 'protected against threats' does so through building a strong military but only exercising it defensively within its borders, and by building good faith relationships with other governments through diplomacy.