The Overmind created a new cerebrate with only one purpose in mind; to protect the chrysalis which now held the captive Kerrigan. The Overmind told the cerebrate that as long as the chrysalis and the creature inside survived, the cerebrate would also continue to live.
Why did the zerg take Kerrigan?
Kerrigan at New Gettysburg Mengsk ordered Kerrigan to protect the primary zerg hive from the protoss Expeditionary Force, allowing the zerg to complete the Confederacy's destruction.
Why did Kerrigan kill the cerebrates?
Cerebrates can't exist in isolation of the Overmind, that's why they had to build a new one. Kerrigan meanwhile would fall under a new Overmind's control should it reach a stage where it could fully control the swarm. So Kerrigan axed the Overmind, and thus any hope at surviving cerebrates.