Then Saul said to the Kenites, "Go, depart; go down from among the Amalekites, lest I destroy you with them. For you showed kindness to all the people of Israel when they came up out of Egypt." So the Kenites departed from among the Amalekites.
1 Samuel 15:6 ESV
Saul didn't always do the wrong thing. He wasn't a completely evil man. He gave up significant military advantage by warning the Kenites, a tribe of Midianites, of what was about to happen.