Speaking of his trials, Job says, "But he is in one mind, and who can turn him? and what his soul desireth, even that he doeth. For he performeth the thing that is appointed for me: and many such things are with him." (Job 23:13-14)
Psalm 105:25 He turned their heart to hate his people, to deal subtilly with his servants.
All things are encompassed within God's governance of His universe. Otherwise, some things would be occuring outside of His Divine governance. There is always some element that certain things that are wrong for us according to His precepts, are not wrong for God. For example, God (as sovereign and creator) may take life/kill where we may not. Examples of this abound in the Scriptures. And there are a few times God is portrayed as "causing" something that might "seem" sinful (but is not). As Gordon Clark writes, "The Jews ought not to have demanded Christ's crucifixion. It was contrary to the moral law. But God decreed Christ's death from the foundation of the world." Or, attributing David's numbering of Israel to both God and the Devil. Or, for example, the lying of the lying prophets in I Kings 22 is attributed to the will and definitive affirmation of God. To simply believe this story exactly as Micaiah tells it might land one in hot water!