There's always huge issues with KP in that he does whatever he wants and will not abide by his Captain's instructions, which in turn does nothing for team morale.
Alastair Cook is not a strong enough leader to control KP, so one of them had to go and it's no surprise it is Pietersen.