Barney's character is supposed to make you feel like that. Across the whole series his friends call him "The worst person on earth" and things like that. Also, he's the one that gets the most character development,even if the final episode misses the mark on that.
He's supposed to be a parody of how gay men are portrayed by straight actors in media, being a straight charater portrayed by a gay actor.