A man thinks that Thing-A is Very Bad. He also thinks that Thing-B is Very Bad. He has to admit, however, that Thing-B makes Thing-A Slightly Less Bad. So he has to concede that if you are going to do Thing-A (which you really shouldn't) then you probably ought to do Thing-B (bad as it is) because it reduces the badness of Thing-A.
So, for example: someone might say "I don't think you ought to eat animals; and since I don't think you ought to eat animals, I certainly don't think you ought to work in a slaughter house. But since some people are going to eat animals anyway, it's better for there to be some very skilled slaughter house workers who ensure that the cattle are killed quickly and efficiently, than for the job to be done by incompetent botchers who make the poor brutes suffer more than they need to. In that sense, the slaughter-man, while doing a 'bad' thing, is also making a bad thing slightly less bad. 'Making a bad thing slightly less bad' could be described as good'."
Or: "I don't think we ought to have wars, but if we absolutely must have wars, then at least let's have soldiers who follow the laws of chivalry, obey their commanding officer, don't torture captives or civilians (and lets have clever commanders who win battles efficiently so the dreadful thing doesn't drag on too long.) If war is wicked, then it's wicked to be a soldier; but its possible to be a soldier in such a way as to make war less wicked than it would otherwise be, which is, in that limited sense, good."
If someone came along and chopped your arm off out of the blue, you would probably be quite peeved. But if your arm was riddled with gangrene and you were about to drop dead, then you'd be quite relieved. You'd probably say "thank you" to the surgeon who performed the amputation. But you'd much rather not have had gangrene to begin with. Something can be "good" in itself, like happiness and sunshine and fluffy animals; but it can also be "good" in the sense of being less bad than the alternative. (Occasionally, without being cruel or callous, we can be thankful or relieved when a very sick or very old person died.)
When the Pope says this, it's terribly surprising, hypocritical and controversial, apparently.