What purpose does sociopathy serve?

Do we know for sure that it’s not simply a modern phenomenon for sociopaths to be somewhat tolerated by the rest of human society? Maybe it only exists today because we don’t drive out the misfits with flaming torches and pitchforks quite so much nowadays.