Communities were not doing fine. CoC didn't come out of nowhere because someone was bored. Having a CoC doesn't absolve moderators any more than having laws absolves judges from having to make good rulings.
I've been part of a lot of communities and never have I felt that a CoC was missing or needed. CoCs didn't come because they were needed but because of a social justice fad. Have a look at the Tim Peters incident with the Python community. The decision to suspend him, a core maintainer (he wrote the Zen of Python), was justified by made-up absurd alleged CoC violations. Without a CoC they couldn't have suspended him as easily without totally losing their face.
I've been part of a lot of communities and never have I felt that a CoC was missing or needed. CoCs didn't come because they were needed but because of a social justice fad. Have a look at the Tim Peters incident with the Python community. The decision to suspend him, a core maintainer (he wrote the Zen of Python), was justified by made-up absurd alleged CoC violations. Without a CoC they couldn't have suspended him as easily without totally losing their face.