From a Calvinist point of view there are two wills of God, his Secret Will and his Revealed Will. As it says in Deuteronomy 29:29:
The secret things belong to the LORD our God; but the things that are revealed belong to us and to our children for ever, that we may perform all the words of this law.
His Revealed Will is all the commandments of God, how he wants us to act towards himself and others. It includes the ten commandments and all the commands which flow from these, such as faith in him, etc.
This Revealed Will is constantly being rebelled against by sinful man.
Then there is his Secret Will: or let me call it the Will of his Providence, (seeing as it is not always entirely secret). The Will of his Providence is the eternal plan that he has for the entire universe, the whole human race and literally everything that happens, or will happen in the future. This will cannot be thwarted because God is sovereign and has planned literally everything, from the number of the hairs on your head and the falling from the sky of a dying bird to the setting up and the pulling down of the rulers of the nations.
So the killing of Jesus by the hands of wicked men was contrary to his Revealed Will... he forbids all murder... but it was in accordance with the Will of God's Providence, Acts 2:23. The same also is true of the casting of Joseph into the pit by his brothers... it was contrary to God's Revealed Will, but in accordance with the Will of his Providence. These two examples suffice to show that even man's rebellions are part and parcel of the Secret Will of God, the Will of his Providence. God brings good out of man's wickedness. So the wickedness of men is in God's plan, but God is not guilty of the sin of man's evil, because, though men intend to be and do wickedly, though men intend great harm, God intends to, and does, bring good out of man's wickedness (Genesis 50:20).
If God can be thwarted by man's sin then He would be forever thwarted and it's difficult to see in what sense the Psalmist could say "The LORD reigns" (Psalm 97:1) neither could that great king of old have truly said
and I blessed the Most High, and praised and honoured him who lives for ever. For his dominion is an everlasting dominion, and his kingdom endures from generation to generation. All the inhabitants of the earth are accounted as nothing, and he does according to his will in the host of heaven and among the inhabitants of the earth, and none can stay his hand or say to him "What are you doing?"