I want to make a distinction that I've long thought is quite important, but which I think is not made enough. Suppose the theist responds to the problem of moral evil by saying that God's allowing moral evils is justified by the value of free will. There are two different ways that "the value of free will" could be invoked here.
First, the theodicy could depend on the intrinsic value of freedom itself. God allows me to freely choose the wrong thing, because my freely choosing something is intrinsically good qua free choice even when the thing I choose is bad.
Second, the theodicy could depend not on any value of the freedom in freely choosing the wrong thing, but only on the value that there would be in freely choosing the right thing were one to choose that. On this story, the only logically possible way God can have a chance of my freely choosing right over wrong in a given situation is by allowing me to have the possibility of choosing wrong over right in that situation. Notice that on this second story, if I end up freely choosing wrong over right, the evil of my choice might well be gratuitous in the sense that there is no compensating good for it. But even if the evil is gratuitous, God could be justified in permitting the evil to happen, since the only way he had to prevent it would have removed all possibility of my freely choosing right over wrong. This second story doesn't require there to be any intrinsic value in freedom as such. It only requires there to be value in freely choosing right over wrong.
I think the second story is superior to the first. But, interestingly, the second story is not available to a Molinist. For the second story only works when God cannot rely on knowing how you would choose in a situation when setting up the situation. (The story is available to a simple foreknowledge theorist if God cannot rely on knowledge of the future in ways that set up explanatory circularity.)