The free will does not mean to choose the wrong, but to be held responsible about one's act, or else if without free will, anyone may not be taken to account.
So the criminal has the free will, but will be punished, and the disbeliever has the free will so he will be punished, and the believer who works righteousness will be rewarded.
Satan, out of his pride and self conceit, did not obey God's command to prostrate himself before Adam, and he was then driven out of Paradise or Heaven.
And Satan was ungrateful to God Who gave him a good position making him a chief of the angels, so instead of being grateful, he did not obey his Lord, and so was punished.
Then he beg for a respite till Doomsday, and so God gave him such respite as a reward for his past obedience and righteousness.
Moreover, Satan envied Adam and became his enemy and the enemy of his seed.