There are some who want to force things by their own will and manipulate things and people for their own benefit. This is the kind of magic (occult arts) Simon was doing. He was able to amaze people by his actions. We are not told just what he did because that is not the point of the story. He was entertaining demons and deceiving people which made him a great sinner.
So even if he did profess belief in Jesus as Messiah, it did not go very deep. He was so steeped in his magic thinking, he believed he could buy what the Holy Spirit gave freely to those who believed in Jesus. He only saw amazing things, not the power and relationship with God. His mistake was trying to make God as low, as manipulable as the demons he was used to.
Giving up the delusion that he was amazing and powerful was hard for Simon to do. He could not see that Jesus had a different kind of power and was much more for loving people. God does not manipulate but God does have commandments for people to follow to stay in his presence. God did have conditions and reasons for what he did. And now it was Simon who was amazed.
These people in Samaria did believe in Jesus as their Savior. They did want to be part of God’s kingdom. But even though they saw what Philip could do while working in the Spirit, they did not receive the power of God in the Holy Spirit. They were baptized into Jesus only.
The Apostles in Jerusalem heard what happened in Samaria and sent Peter and John to check it out. Both Peter and John were full of the Spirit of God. They had been doing signs and wonders for a while. They were sent to see how the preaching was working among non Jewish people.
One thing the two Apostles wanted to see was that these new believers had received the Holy Spirit. Being baptized in the Holy Spirit would be the difference between nice ideas and powerful faith. The Apostle knew that if the kingdom of God was to spread, the power of God to do miracles would need to be for all believers. So now these new believers were baptized into the Holy Spirit as well as the baptism of Jesus they already had. As the two Apostles laid hands inn prayer on these new believers they received the Holy Spirit.
This transfer and blessing of the Holy Spirit impressed Simon. This would be a new way to use his own power to gain money. He asked for this blessing as if it were a business transaction. He showed his lack of understanding of God’s kingdom of grace and compassion.
So Simon was scolded instead. He was again trying to manipulate things which was the opposite of the kingdom of God. He was told to repent and see if his heart could be cleansed. Peter told him he was in bitterness and wickedness. Here was an opportunity to look at his heart to see how his magic manipulations were different from the flow of God’s Spirit.
Bitterness against God means no trust in God. It means disregarding God’s way of doing things. It means trying to use human means to force things to go the way you want. It is opposing God. So Simon was stuck in his limited understanding of what salvation was. The only way out of his bitterness and wickedness would be to repent to God for refusing to follow God’s plan. Simon would have to unlearn his focus on his way and learn how to focus on God.
For us today, leaving behind magic involves repentance and study and prayer and worship of the one true God. Trying to force things the way we want them removes us from the power and grace of God. Jesus is our example of love and grace so we can see how awesome God is. Through Jesus we find that the rules and laws of God lead to more peace in mind and heart. God is trustworthy and full of goodness and it is ours if we follow the way of Jesus.