Perhaps check references to determine if either candidate was able to work well in the type of environment you provide.
For example - the nice person may be lazy, or the abrasive person may productive and helpful.
It's been my experience that contacting the candidates references will flush that information out. Even in this age of litigation - I've always been able to get an answer to "Please rate on a scale of 1 to 10"
We've avoided some people that interviewed well and had great skills but were horrible human beings - and we've picked up some people that are hard workers that are willing to learn that didn't interview well.
If your hiring criteria excludes groups like that by a "fast friend" proxy test, then yeah, you should be taking the better programmer.
Sure, it'll be more productive for everyone if I tell someone that we think they're just not smart enough to learn shit as fast as we need them to. But that hurts. So we say "You're great, but we're looking for someone with just a few more years of C++ experience". Similarly, when we think you've been acting like an arrogant dick, we say "lack of culture fit".
I once rejected someone whose English was so bad that I couldn't understand them on the phone. That's a hard thing to tell a foreigner who has the courage to call you up, by phone, in a language they probably know they're not great at, for an internship position! So I lied and I told them they had insufficient React experience. Am I proud of that? No. I'm still not sure what I should've done.
I see this trope a lot on HN that "lack of culture fit" means "wrong brand of sneakers" and it's usually nonsense. "No culture fit" means "there's something specific that we dislike about the way you behave or communicate but we don't want to hurt your feelings more than necessary".
Candidate one gives off slightly anti-social vibes but is brilliant, candidate two jokes around with me during the interview and is smart as well, but less so than candidate one. Am I justified in going with candidate two on a hunch?
This doesn't even touch even more difficult situations like when your friend messes up and needs to be dealt with in a professional but non-personal manner.
So yeah, hire the better coder.