William Gurnall, the 17th century Anglican, explains how God uses Satan's temptations in his classic work, Christian in Complete Armour.
God makes Satan's temptations the courier of His love to the saints...And what did Satan get for all the energy he spent on Job, but to let that holy man know at last how dearly God loved him?
The devil thought he had the game in his own hands when he got Adam to eat the forbidden fruit. He supposed he now had man in the same predicament as himself. But did he catch God by surprise? Of course not! God knew the outcome before the match was ever begun and used Satan's temptation to usher in that great gospel plot of saving man by Christ. At God's command, Christ undertook the charge of wrestling His fallen creatures from Satan's clutches and reinstating them to their original glory, with access to more than they ever had at first.
God never condones wickedness in His saints, but He does pity their weakness. He never sees a saint in mourning without planning to clothe him in the sunlight of His love and mercy. God can, in fact, use His saints' failures to strengthen their faith, which, like a tree, stands stronger for the shaking.