As someone who has run quite a few projects and communities in the past, my tip is straightforward: ban hammer on the first instance, no warnings, no questions.
At the first sight of an idiot, nuke them from orbit and do the same to anyone who hints compassion towards the idiot.
This ensures more good people will flock, because often they refrain from engaging because they can't stand idiots.