This is almost certainly a reaction to Mozilla being attacked for the political/religious views of some of their contributors. The case of the CEO is the most well known (and granted a bit exceptional, so I won't consider it further), but due to the actual diversity of the Mozilla community people on both extremes of the relative spectrum spoke out and the CoC makes it clear when they can do so without retribution in the project, provided they don't use project resources to spread their opinion.
I think that's an example of a positive effect of a CoC.