I have very little to add to Father Mike's wise and moving words. So I will just share his knowledgeable explanation. Short answer, we have free will, and he honors that. God did not even will that Jesus die. That was not part of his perfect will, but he used it for the greater good. When something happens that is not part of His perfect will, he can bring about a greater good from even the most evil, heartbreaking, or tragic of things.
Father Mike Schmitz via Ascension Press: Why does God let bad things happen?