I just pulled up a video that I remember having particularly bad comments, and the comments were gone. I guess that channel does have a code of conduct, even if it's not formalized. I don't know that publishing a CoC document "solves" anything, but at the very least it acknowledges that the sort of conduct I was illustrating does exist and should be discouraged.
Perhaps it's along the same lines as the "don't piss in my pool" sign. Some visitors may see it as a sign that you care about water quality and will feel safer jumping in. Others might wonder if it indicates that a lot of people do piss in your pool.