Ever wondered how God could allow ice cream to melt, bubblegum to lose its flavor, and all kinds of even worse things? Well, there's branch of theology called theodicy that defends God's goodness in the face of such evils.
The term comes from a book called Theodicee (from the Greek word for God, Theos, plus the Greek word for justice, dike) written by the famous seventeenth-century German philosopher and mathematician Gottfried Leibniz. In it he argued that our world was in fact "the best of all possible worlds." He didn't mention ice cream or bubblegum, though.