The Scripture forbids any attempt to contact the dead, or to consult with those who have familiar spirits or with wizards (Leviticus 19:31; 20:6). The law of Moses imposed the death penalty on those who had familiar spirits (Leviticus 20:27).
Why might this appearance of Samuel have been Satan? Well idolatry was Satan worship, or the form of Satan worship practiced at the time. People often ask this question, where is Satan in the Old Testament? And cynics, people cynical toward the Bible, say, ‘There is nothing about Satan in the Old Testament; he only appears in the New Testament, and they make great mileage with various jibes along these lines.’ Of course, it is quite inaccurate. Satan appears first of all at the very beginning in the garden of Eden, and is alluded to in very many ways from that point on. But the appearance and the worship of Satan – that is to say, the turning away from God, and the seeking out of an alternative that you may enthrone and worship – that is idolatry. That is the form in which Satan misled and deceived the people for centuries. That was the evil of it and the wickedness of it. The Puritan view of this passage is that Satan has misled and deceived Saul all his life. Saul has disobeyed God, and is only a nominal believer. He has used him in wicked pursuits, particularly against David, and now he moves in to finish him off, because Satan knows that Saul is under God's condemnation. Satan is not going to say to Saul, ‘You are mine; I'll look after you; I’ll give you a good message, and comfort, and set your heart at ease?’ No, when the final moment comes, Satan, who has kept a low profile, will move in and destroy him. Of course it will be God who destroys him, but Satan will ‘rub it in’. That is the other view of what is going on: that Satan caused some image of Samuel to rise up. Anyone who is only a nominal believer, who will not repent of sin, will not really come to Christ and yield to him and depend upon him; well you are in the service of Satan, and Satan actually hates you, and will be always vindictive against you. When it comes to the end of life, Satan will finally make it as bad as possible for you, and take absolute advantage of his victory and your vulnerability, because he is a malevolent spirit, and he hates you.