You may have intended for this to be a “defense”, but it appears to be mostly a reinforcement of what many have already written in the critical pieces on SO. Your observations about what’s going on are quite accurate. Unfortunately, I believe the problem is that the behaviors you describe (and that others have also done) are indefensible.
They have a code of conduct. It’s just not followed by a more-than-insignificant number of posters. If it was adhered to, there would not be any issue here.
I will say — it’s not just SO. It’s just about every online forum/community populated by tech folks. We apparently just can’t resist being assholes. I suspect there’s some sort of psychological explanation for this, but never having done much study of human behavior and being something of an introvert myself, I couldn’t tell you what it is.