Instead, you should try to accept the truth: free speech is ugly, deal with it. There always are some people, who are nice, but all people are never nice. A lot of different people with different opinions freely voicing their opinions in the public space will always be ugly.
Ok, now let's assume you don't care and get to actually answering your question. In order to remove "ugly" you need to remove some of the elements:
1. Different opinions. People with different opinions are removed from society, everybody in the community must be as similar as possible. There are multiple ways to achieve that to multiple degrees, but the key is closed communities, since banning faster than they appear (or find a way to return, which is relevant for the web) is a hard work.
2. Freely voicing them. Again, multiple ways: good old moderation of the content, make everybody have a stake in what they are saying (reputation systems, goods exchange, game mechanics enforcing cooperation), etc.
3. Public space. Move all discussions to PM, so they still argue, but you don't see it and feel good about yourself and your platform.
4. Speech. Just don't let people communicate. Easiest to achieve on a given platform, and the most effective.