Emphasis mine.Sometimes doing the right thing leads to suffering, like sometimes doing the wrong thing leads to prosperity. Doesn't change the actions themselves, and the type of person making them. Though, folks do find happy points a compelling argument and salve to the hurt caused on the way.
In the context of D&D, where morality is objective, this is true. But it is also perfectly reasonable from a philosophical point of view to say that the morality of an action is based solely on its outcome. Whether an action was good or evil is entirely dependent on whether it resulted in good or evil. Or, it is entirely possible to say that the intent behind an act is the definition of whether it is good or evil, regardless of its outcome.
But, in D&D, what is Good is a defined objective truth based on immutable cosmic laws. "Good" is as true as the speed of light or the effect of gravity. In that light, the question of morality isn't really that interesting.