Do we know for certain that Section 31's existence is illegal? Certainly we know that some of their actions are reprehensible, if not illegal under Federation law. But Does that mean the organization's existence itself is a crime?
Yes, it does mean exactly that. Section 31 routinely violates Federation law whenever it suits them.