Even doers of right have bad days... days when they feel beat up, battered and bruised. When it seems that evil actually will win the day! It happened at least once to the League and Society of Justice, and someone actually made a federal case about it!
For the Justice League, it happened early in their career when master villain Doctor Destiny used his materiopticon to create evil duplicates of the team, which framed his enemies. Facing a harsh judgment, defense attorney (and Atom's girlfriend) Jean Loring petitions the judge to exile the JLA rather than convict them which he agrees to readily.
As to the Justice Society, they never actually have a judicial case lodged against them, but rather their second congressional inquiry (the first was quickly dismissed when the JSA resigned, except for Wonder Woman). Framed for treason by a damaging diary left behind by the late honorary member, Batman, the Society were defended by defense attorney (and member the Huntress) Helena Wayne. She and her rival for the prosecution, Richard Grayson (aka Robin) uncovered a deep dark secret behind their patriarch's mad ramblings.
The Earth-Two Batman subconsciously wanted to tip off the JSA to the return of Per Degaton, despite the adverse effects of cancer which caused him to lose his discretion. And the Justice League were able to combat their duplicates while in their civilian identities with the help of minature Atom playing havoc to the duplicates.