Old Testament writers often said stuff like this, that God sent evil spirits and such. Languate like that is very common in the Old Testament.
*God put an evil spirit between Abimelech and the lords of Shechem, and the lords of Shechem broke faith with the house of Abimelech. (Judges 9:23)
The spirit of the LORD had departed from Saul, and he was tormented by an evil spirit from the LORD. (1 Samuel 16:14)
**The next day an evil spirit from God *rushed upon Saul, and he raged in his house. (1 Samuel 18:10)
The Bible even records what appears to be God asking the angels and spirits in heaven for a volunteer to lie to someone so that they might be killed.
**Micaiah continued: “Therefore hear the word of the LORD: I saw the LORD seated on his throne, with the whole host of heaven standing to his right and to his left. The LORD asked: Who will deceive Ahab, so that he will go up and fall on Ramoth-gilead?And one said this, another that, until this spirit came forth and stood before the LORD, saying, ‘I will deceive him.’ The LORD asked: How? He answered, ‘I will go forth and become a lying spirit in the mouths of all his prophets.’ The LORD replied: You shall succeed in deceiving him. Go forth and do this. So now, the LORD has put a lying spirit in the mouths of all these prophets of yours; the LORD himself has decreed evil against you.” **(1 Kings 22:19-23)
Note in the passage above, how the story if the lying spirit sent by God is a vision from the Prophet Micaiah. Prophets were very dramatic and flamboyant. They often used hyperbole and dramatization to exhort and teach. Their storys are meant to teach something specific and are often not meant to be taken literally.
In the case of Saul above, and Pharoah, it could have been the author’s incomplete understanding of God. Remember that the fullness of revelation did not come to man until the Advent of Christ, and until then, God had not fully revealed himself to man. Jesus himself corrects several misunderstadings about the nature of God, sin and death, such as the belief that sin was always the reason for bad things happening and that suffering was always proportional to the gravity of the sin.
He said to them in reply, “Do you think that because these Galileans suffered in this way they were greater sinners than all other Galileans? By no means! But I tell you, if you do not repent, you will all perish as they did! Or those eighteen people who were killed when the tower at Siloam fell on them—do you think they were more guilty than everyone else who lived in Jerusalem? By no means! But I tell you, if you do not repent, you will all perish as they did!” (Luke 13)
So I think it reasonable to conclude that man just did not have a complete understanding of the nature of God at that early stage. Christ is the fullness of revelation, so there will be no more revelation, but guided by the Holy Spirit, the Church is still learning and discovering more about that revelation and developing doctrine even to this day.
-Tim-