William Peter Blatty said this quote

Perhaps evil is the crucible of goodness... and perhaps even Satan - Satan, in spite of himself - somehow serves to work out the will of God.