The US Army had soldiers peeing on enemy corpses. Was that act a crime or is the whole US Army a crime?
The difference is, while it is possible for individual soldiers to commit crimes, the actual US Army is a completely legitimate organization with a chain of command and responsibility to the government. The Army, along with all other armed services, has to answer to the President. Section 31 answers to no one
. Doesn't that sound dangerous?
As for the two Starfleets: While there are some obvious things, such as rank structure, that the Federation Starfleet inherited from Earth Starfleet, that still doesn't change the fact that they are completely separate organizations. The Federation Starfleet, for example, also fulfills military/defense functions, which the Earth Starfleet did not. In any case, to assume that the Earth Starfleet charter was simply copied, unaltered, for use in the Federation Starfleet, is not terribly likely.