Satan did have freedom to go from heaven to earth as he pleased.
Job 1
6 Now there was a day when the sons of God came to present themselves before the LORD, and Satan also came among them. 7And the LORD said to Satan, "From where do you come?"
So Satan answered the LORD and said, "From going to and fro on the earth, and from walking back and forth on it."
8Then the LORD said to Satan, "Have you considered My servant Job, that there is none like him on the earth, a blameless and upright man, one who fears God and shuns evil?"
9So Satan answered the LORD and said, "Does Job fear God for nothing? 10Have You not made a hedge around him, around his household, and around all that he has on every side? You have blessed the work of his hands, and his possessions have increased in the land. 11But now, stretch out Your hand and touch all that he has, and he will surely curse You to Your face!"
12And the LORD said to Satan, "Behold, all that he has is in your power; only do not lay a hand on his person."
So Satan went out from the presence of the LORD.
lucifer wanted to be "like the most High" like God. The prophet Isaiah predicted the fall of satan from Heaven.
Isaiah 14
The Fall of Lucifer
12 "How you are fallen from heaven,
O Lucifer, son of the morning!
How you are cut down to the ground,
You who weakened the nations!
13For you have said in your heart:
"I will ascend into heaven,
I will exalt my throne above the stars of God;
I will also sit on the mount of the congregation
On the farthest sides of the north;
14I will ascend above the heights of the clouds,
I will be like the Most High.'
15Yet you shall be brought down to Sheol,
To the lowest depths of the Pit.
The Messiah Jesus also saw the fall of satan from Heaven
Luke 10
17 Then the seventy returned with joy, saying, "Lord, even the demons are subject to us in Your name."
18And He said to them, "I saw Satan fall like lightning from heaven. 19Behold, I give you the authority to trample on serpents and scorpions, and over all the power of the enemy, and nothing shall by any means hurt you. 20Nevertheless do not rejoice in this, that the spirits are subject to you, but rather rejoice because your names are written in heaven."
The fall was described in the book of Revelation
Revelation 12
7 And war broke out in heaven: Michael and his angels fought with the dragon; and the dragon and his angels fought, 8but they did not prevail, nor was a place found for them in heaven any longer. 9So the great dragon was cast out, that serpent of old, called the Devil and Satan, who deceives the whole world; he was cast to the earth, and his angels were cast out with him.
Upon the return of the Messiah, satan will be bound and imprisoned for 1000 years:
Revelation 20
1 Then I saw an angel coming down from heaven, having the key to the bottomless pit and a great chain in his hand. 2He laid hold of the dragon, that serpent of old, who is the Devil and Satan, and bound him for a thousand years; 3and he cast him into the bottomless pit, and shut him up, and set a seal on him, so that he should deceive the nations no more till the thousand years were finished. But after these things he must be released for a little while.
satan will be released and will deceive the nations once more and lead them into the final rebellion against God. He will be defeated and cast into the lake of fire:
Revealtion 20
7 Now when the thousand years have expired, Satan will be released from his prison 8and will go out to deceive the nations which are in the four corners of the earth, Gog and Magog, to gather them together to battle, whose number is as the sand of the sea. 9They went up on the breadth of the earth and surrounded the camp of the saints and the beloved city. And fire came down from God out of heaven and devoured them. 10The devil, who deceived them, was cast into the lake of fire and brimstone where the beast and the false prophet are. And they will be tormented day and night forever and ever.
All Praise The Ancient Of Days