We can't say “he is justified in moaning because he has pains” if we call pain the justification for moaning. – We can't say “he is justified in expressing pain, because he has pain” unless we wish to distinguish this case of being justified in expressing pains from another way of justification, e.g. that he is on the stage & has to act a sick man.