The Starfleet charter states:
Article 14, Section 31 of the Charter made allowances for bending Starfleet regulations in times of extraordinary threat.
Right below that sentence on the wiki page it says:
This section was cited as the foundation for Section 31 even into the late 24th century.
So we have the why, but who created Section 31? Was there a specific individual or was it a committee?