Whereas classical Greek religion ascribed to the gods very human foibles, theism from Plato onward has affirmed that God is purely good and could not be the author of anything evil (Republic). . . .
As to our knowledge of divine goodness, Aquinas separates the order of being from the order of knowing: all goodness derives from God but we understand divine goodness by extrapolating from the goodness of creatures. For Aquinas, this requires an analogical (as opposed to an equivocal) relationship between divine and human goodness. For Kant, divine goodness is known as a postulate of pure practical reason: God must be there to reward virtue and punish evil.
The greatest challenge to belief in divine goodness has been the fact that evil exists, or more recently, the amount and type of evil rather than the mere fact of it. The problem is lessened if it is acknowledged that divine goodness does not require that each creature always be made to experience as much happiness as it is capable of experiencing. Reasons may include, for example, that: it is impossible that all creatures collectively experience maximal happiness (e.g., because the maximal happiness of one precludes the maximal happiness of another), or that there is some higher good than the happiness of all creatures (e.g., John Hick’s view that maturity is that higher good, and acquiring it may entail some displeasure), or that some forms of good are manifested only when certain types of evil exist (for example, forgiveness requires wrongdoing . . . ); or because God’s favor is undeserved and not given in response to merit, it cannot be owed and God cannot be faulted for not giving it. (See full article)
— Brian Morley, “Western Concepts of God,” The Internet Encyclopedia of Philosophy