Consider the following alternative scenario: God creates free creatures, but he ensures that whenever they make a choice between good and evil, the evil is only minimally attractive, i.e., attractive only to such a minimal degree that it is just barely possible to choose the evil. (If one thinks that it is possible to choose what is completely unattractive, then evil in that world will have no attractiveness at all.) We could even imagine that in that world we have vivid images of the sufferings in hell that would result from a sin whenever we contemplate the sin. It seems probable that there would be a lot less evil in such a world than in ours. Yet it is a world where there is genuine, morally significant free will.
This raises the question: Why did God create our world, where evil is sometimes very attractive?
I think an answer might be this. To find something attractive is to see it as in some way good. Indeed, the evils that we are tempted to are evils that we see, and often correctly, as in various ways good. Robbing a bank in a profitable way is in various ways good, because the profits can be used for many a good. An evil is attractive to the extent that we see goods in it. Suppose we see very clearly these goods, and still choose to act virtuously, to fail to rob the bank, say. Then we are not only manifesting love of the good promoted by the virtuous action, but we are loving that good over other goods. The more vividly these goods associated with the evil are presented to us, the greater the love of the good promoted by virtue is when we choose that good over the goods associated with the evil. And if we had vivid images of the sufferings to us resulting from the evil choice, then our choice of the good would not manifest much love of the good, but only a hatred of personal suffering.
Thus, in order to allow a greater love, God calls on us sometimes to choose the good over not just an evil, but over an attractive evil, an evil bound up with goods that sparkle.
But couldn't God get the same comparative love out of us by making it possible for us to choose greater goods over lesser ones, without the greater ones being obligatory, in the way in which he presents Christians with the choice between celibacy and marriage, with celibacy being better, but marriage still being good? Then if we chose the greater good, we'd be loving the greater good over the lesser one, but there would be no possibility of evil, since even if we chose the lesser good, we'd be acting rightly. And wouldn't that be a better arrangement than the one we in fact have?
Not necessarily. For there is a special value in not just choosing the good, but choosing the good dutifully. Such choice reflects the humility of a creature under the moral law. Probably the better world is one that contans both kinds of choices: sometimes choosing between a greater good and a lesser one where both choices are permissible, and sometimes choosing between a greater obligatory good and a lesser good that is associated with something impermissible. And that is how our world is.