1 Chronicles 10:13 tells us God put Saul to death because he broke the covenant. Saul was the first real king of Israel. Israel sinned by demanding a king instead of following God through is prophet, Samuel. (1 Samuel 8) This was a breach of the covenant because God was the sovereign under the covenant and Israel, his vassal, promised to obey his laws. (Exodus 19) In return, he would protect them and provide for them.
Israel rejected God as king, or sovereign, and demanded a man as king a man, to protect them (fight their battles for them). They wanted to be like the nations around them. So, peer pressure has been around a while. (1 Samuel 8:20) Since Israel breached the covenant, God could have imposed the curses of the covenant and left Israel to be devoured b y the surrounding nations. God demonstrated his ability to do that that in 1 Samuel 11 by letting the Ammonites overrun part of the country.
But God, in mercy, told Israel they could go forward in the covenant if both the king and the people kept his laws. (1 Samuel 12:14) So, it was the king's responsibility to keep the law of the covenant and lead the nation to keep the law. He demonstrated his mercy by causing the Spirit to fall on Saul, empowering him to rally the nation and defeat the Ammonites.
The Chronicler, then, takes pains to make sure readers understand Saul's failure and the penalty. Saul died for his breach of faith. He, as Israel had before him, looked to things other than God for power and protection. He consulted a medium, asking for guidance. (1 Chronicles 10:13) The reason God forbids mediums, astrology, witchcraft and necromancy is that they are methods of seeking power or knowledge outside of God. When you read your astrology chart for guidance, for example, you are saying the stars control your fate rather than God.
God put Saul to death for his sin. The wages of sin is death. (Romans 6:23) But, in mercy, God gave David to Israel as king. I sinned. The wages of my sin is death. But God, in mercy, gave me the Son of David to save me from that sin and to be my king forever and ever.