This is stated a number of times in 1 Samuel; the first is 1 Samuel 16:14 “But the Spirit of the LORD departed from Saul, and an evil spirit from the LORD troubled him”. I believe the thought here is that when God is with you, you will be seen as having a good spirit, because of your desire to do good. But when Samuel said to Saul, 1 Samuel 15:28 “The LORD has torn the kingship of Israel away from you today and has given it to your neighbor who is better than you”, Saul should have given up the Throne to the one that God was giving it to. But Saul liked the power and adulation that came with the position and did not want to give it up. Saul knew that he was fighting against God in his endeavor to keep the Kingdom for himself and his son. Saul had changed from the man he once was. It was power and the desires of the flesh that changed him. So God determined to make an example of Saul for all to see.
This is similarly expressed in 2 Thessalonians 2:11-12 “And for this cause God shall send them strong delusion, that they should believe a lie: That they all might be judged who believed not the truth, but had pleasure in unrighteousness”. There is a major misconception that is taught by the Churches, today, when they teach that God is looking to have all saved now in this lifetime. Again if that were true then why would he say Luke 8:10 “Unto you it is given to know the mysteries of the kingdom of God: but to others in parables; that seeing they might not see, and hearing they might not understand”. And again in Isaiah 6:10 he states “Make the heart of this people fat, and make their ears heavy, and shut their eyes; lest they see with their eyes, and hear with their ears, and understand with their heart, and convert, and be healed”.
From the scriptures cited, I hope that you see that this is not an anomaly. Today God is looking for the Bride of Christ. When all the members of that bride class are found, tried and tested; then God will turn his attention to the conversion of the world, and the world will become the children of the second Adam and Eve i.e. Christ and the Church. As is also stated in Romans 8:19-21, “For the earnest expectation of the creation waits for the revealing of the sons of God. For the creation was subjected to vanity, not of its own will, but by reason of him who subjected it, in hope that the creation itself also shall be delivered from the bondage of corruption into the liberty of the glory of the children of God.”