It's better to create a system of reputation independent of real-world identity. If new users have limited privileges until they've been around for a certain amount, or if only one account is permitted per IP, even an anonymous account with a name like XxX_FakeName_XxX becomes an identity with value and a reputation. By engaging in bad behaviour, that identity would lose reputation, and might even be banned. Because of the loss of privilege or technical challenge associated with creating a new account, bad behaviour is disincetivized without actually attaching real-world identity to anything online.
There's a balance to be found between lowering barriers to entry and raising barriers to re-entry, but if the balance is done properly it can make a big difference.
Of course, none of this works without moderators doing the legwork of throwing out bad actors, but this is the difference between effective moderation and token moderation that is too swamped to actually do anything.
This also works better in smaller communities, but I think smaller online communities are just healthier in general. This is part of why monoliths like Facebook and Twitter are so toxic -- there is no "Twitter community," rather there are a thousand Twitter communities all of which are bumping into each other constantly because they occupy the same space.