"Please explain the 'evil spirit from God' in 1 Samuel 18:10, 19:9. The very idea troubles my heart."
June, you're not the only one who has been deeply troubled by this. I came across several people who read this and other verses and concluded that either 1) God is not all good because He would do evil, 2) God is a liar, 3) God is the architect of evil, 4) God isn't all that powerful, and 5) God is vindictive and petty.
I'll start by looking at the example of Saul and try to trace why he had this 'spirit' descend upon him, and explain some of the different explanations to it and then give my interpretation of it. In the Old Testament, anointing with oil was symbolic of receiving the Spirit of the Lord. So, when Saul was crowned king it came with the anointing from Samuel the prophet. In our context it's receiving some symbol of authority (like when a judge receives the black gown or something along those lines).
So what went wrong? In 1 Samuel 13, Saul is waiting for Samuel to come and offer the sacrifice to the Lord before they go into battle. Saul, being both a good military man but a bad theologian, decides he will offer the sacrifice on his own. Not being a Levite, this was a violation of God's Law. Saul had the best of intentions, but in his desire to please man he disobeyed God. Samuel informs him that God has decided to find a man after His heart who will follow him completely. Then, he makes a rash oath that no one is to eat anything until they win a battle and his son Jonathan eats some honey he finds. This isn't reflective of his rejection by God, just that his mouth operated faster than his head. Then comes the last straw in 1 Samuel 15. Saul is instructed to wipe out everyone and everything when he fights the Amalekites. This practice is called "placing under the ban" which was a common military tactic in the Ancient Near East. Its purpose was to destroy any chance of retaliation, and it also served as an act of worship in the sense that all plunder was to be given to God. Saul decides to keep the best of the livestock for himself, and intends on offering them as sacrifices to God later. Again, good intentions, bad listener. It is then that Samuel announces that Saul is rejected, and in a symbolic act of Saul tearing Samuel's clothing it is said that Saul's kingdom will be torn from him.
It is in 16:14 that this 'evil spirit' makes its appearance. It immediately follows the anointing of David as the true king of Israel. The ESV translates it as "harmful" but the overwhelming propensity of translations uses the word "evil." The issue at stake is the word ra' which can be translated as 'bad, evil, calamity, affliction, distress, etc.' We must first make two assumptions: 1) God is Good, and in Him is no evil, sin, wrong nor can He do evil, sin, or wrong; and 2) We do not see the big picture (the "God's-Eye View"). This spirit is clearly sent to punish Saul for his disobedience and is directly related to the Spirit of the Lord that was present at his coronation.
A couple explanations on this that are presented:
God Allows - This view stresses that God is not the active agent in this evil spirit's working, but is merely the result of God lifting His hand of protection and blessing from Saul. This view has much support, but finds itself lacking a fully sovereign presentation of God. It seems to dismiss actions that we perceive as 'evil' coming from God, though we see in Isaiah 40-48 a big picture of a God who is in control of all things and nothing happens apart from His decree (even the rise and fall of Babylon for the purpose of discipling the Jews). In particular is 45:7 where God declares that He has created light and darkness, and that He makes peace and 'evil' (again, this word ra' which in this context implies judgment against His enemies). We cannot look at this as God creating evil (see Architect view) but instead God saying that all things are under His control and nothing happens without His knowledge and consent.
God is Architect - This view holds that we cannot trust God because He is the architect and designer of evil. It leaves us in a quandary, that either God is truly not all good or He is not all powerful. The conclusion that God is the architect and origin of evil goes against how He is known in Scripture, and so to accept this position would mean to redefine the very understanding of who God is.
God is Helpless - This is the corollary to the Architect position, meaning that God lifts His hand but is powerless or unable to stop what inevitably will happen to Saul. Some would hold this is the view in Job, where all these terrible things happen and strangely God is silent. Again, this view does not present a fair approach to God's sovereignty in all things. This view plays itself out fully in the Open Theist perspective, which is rising in popularity among evangelicals.
I believe that this 'evil' spirit from the Lord is not how we would see as 'evil,' but is instead a spirit of punishment and torment from God for Saul's disobedience. This spirit torments him, but we see God sending both sunshine and storms and both being for His glory. What we may see as evil is likely divine judgment in this context. What we may see as terrible in our eyes, from God's perspective, is good and is part of working towards the ultimate return of Christ and the Kingdom established here on earth.
The context of the word ra' includes evil, but isn't limited to that. It includes calamity, distress, and simply "not good" stuff happening. Clearly this is a spirit that is not doing good thing to Saul, but the evil implied isn't from God it is perspective of those around. God is all powerful and in His all-goodness He is able to take things that are seen as terrible and in fact use them for great good, namely His glory. God uses the terrible actions against the Egyptians in Exodus both as a judgment against them for idolatry and as an act of deliverance for His people. God raises up the Babylonians to discipline and exile Judah. God uses the bloodlust of the Romans as the agent by which His Son is crucified, thus allowing for us to be saved. And God uses the most pagan empire (until America) and its roads and infrastructure to be the avenue by which the Gospel gets spread through the whole world.
In fact, the rest of the story of Saul and David portrays two entirely different stories. It shows the removal of the Spirit from Saul and the consequential results of that. And the great irony is the man who can give him comfort and who is part of Saul's court is the very person whom Samuel had anointed as the successor to the throne. It is a story of tragedy that happens when someone falls away from the Lord and tries to please the people and loses sight of their calling. Saul was a great king early on, but wandered away from the Lord. It isn't a story to gloat over, but rather a warning sign for those of us who are young and upwardly moving... Never forsake that relationship with God through Christ for anything else.
Thanks for the question June. You struggled with this and so have millions through the years. I hope this is of some help, and may God show you His goodness, glory, and the majesty of Christ in all things!