HN is relatively niche, it's not mainstream. Even if a troll posts e.g. sexist or Nazi crap here, it will get no attention due to a lack of fellow Nazis to upvote and engage like on Twitter/FB/Reddit, and in addition both the userbase and the mods are quick in removing trolling, thus further reducing the "profit" that a troll can have from trolling.
Also, HN lacks notifications. No matter if upvotes, downvotes, replys, flags - you have to look yourself in your own thread history. This prevents the rapid heating up of discussions - and the lack of a character limit allows users to properly express what they're thinking, unlike Twitter, thus preventing misunderstandings.
Of course there is karma whoring, I won't deny that - but there's no way you get thousands of karma points/likes/rts/claps/whatever for a simple Fuck Trump/Fuck Clinton. For gobbling up karma on HN one has to write either high quality content or be the lucky one who first submits a link to a SpaceX success or a critical security issue.
edit: Oh, there is one other thing which explains "nicer" for me. HN definitely leans towards the leftie-libertarian side. Usually, hate speech, offensive insults, derogatory vocabulary, discrimination, pointless trolling and other aspects associated with "unpleasant environments" are found on the right-wing/authoritarian/alt-right/gamergate/masculist spectrum.