Saul had committed three great sins which brought about his ruin:
1) He offered sacrifice illicitly - for he was King but was not a priest.
2) He refused to utterly destroy the Amalekites, but kept some of the loot for himself and his men
3) He resorted to superstitious practices in asking the witch of Endor to conjure up Samuel
David, for his part, also committed grievous sins (for example, adultery and murder).
Why, then, was Saul rejected but David favored? Because David, like the Good Thief, repented and found mercy and was incorporated into the Kingdom of Christ.
Listen online [here]!