This isn’t to say that God can’t bring good out of evil. Scripture teaches that “in all things God works for the good of those who love him…” (Rom 8:28). As I read this passage, the phrase “works for” (sunergēo) is all important. In the Greek, “sun” is a prefix meaning “with” or “alongside of.” “Ergēo” means to work to bring something about (we get the word “energy” from it). So the term literally means to work with or along side other things or other people to bring something about. So, it seems that in this passage God is promising to work with us and alongside the circumstances he finds us in to bring good out of evil.
But think about this. If “all things” were already an expression of God’s will, because God is supposedly behind everything, why would God have to work with us and alongside circumstances to bring good about? If all things are already an expression of God’s will, there’s nothing outside of God’s will for him to work with or alongside of.
In this light, I suggest the passage is teaching us not that all things happen for a divine purpose, as though God wills all that comes to pass, but that all things happen with a divine purpose. Whatever comes to pass, however much against God’s will it may be, God works to brings a good purpose to it.