For God would never have created any, I do not say angel, but even man, whose future wickedness He foreknew, unless He had equally known to what uses in behalf of the good He could turn him, thus embellishing, the course of the ages, as it were an exquisite poem set off with antitheses. For what are called antitheses are among the most elegant of the ornaments of speech. They might be called in Latin "oppositions," or, to speak more accurately, "contrapositions;" but this word is not in common use among us, though the Latin, and indeed the languages of all nations, avail themselves of the same ornaments of style.... As, then, these oppositions of contraries lend beauty to the language, so the beauty of the course of this world is achieved by the opposition of contraries, arranged, as it were, by an eloquence not of words, but of things. This is quite plainly stated in the Book of Ecclesiasticus, in this way: "Good is set against evil, and life against death: so is the sinner against the godly. So look upon all the works of the Most High, and these are two and two, one against another."
We find a similar idea in Berkeley's Principles (sect. 152), using painting rather than poetry as the analogue. Today music is probably the most common analogue used. For most of the past sixty years, if you would find a book or article that would discuss it, you would usually find it disparaged, due in part to John Hick's discussion in Evil and the God of Love. (Philip Tallon's The Poetics of Evil seems to be the primary exception.) But rejecting it outright requires drawing a much sharper line between the aesthetic and the ethical than can usually be maintained, and the actual concepts involved, like overall harmony (pankalia), are definitely not solely aesthetic, anyway. Further, we ourselves regularly use broadly the same sort of 'aesthetic criteria' in order to decide how we will handle bad things, what we will tolerate, what we will support, what we will actively punish, and what we will merely discourage. In addition, while it's generally not restricted to such, it's almost always primarily deployed in discussing what has usually been called 'natural evil'; other concerns always take the forefront when talking about moral evil in particular.
In any case, this post is not so much about that; I was just reminded of it by the following fascinating clip from an interview with Herbie Hancock, discussing a time when he hit the wrong notes while playing with Miles Davis: