So you're arguing that if inflicting pain produces better decisions (as it occasionally does), it is not just morally acceptable, but an actual positive force for good?
And when it does, it clearly is good. That's why we evolved pain receptors: because it enables better decision-making capabilities. People who can't feel pain suffer plenty for it, and they live in real danger.