He was possessed by the Dark Voice at the start of his reign and given an overriding directive to destroy the Protoss. However to combat this, the Overmind came up with a cunning plan: Get a new leader for the Zerg.
During a battle on an infested world, Renegade Humans abandoned a squad of their own on the planet. All of them but a strange Ginger were left alive. She held off the Zerg before she was swarmed by thousands of them. They captured her and 'infested' her, turning her into a creepy, winged version of her Human form.
He planned to make her the new leader of the Swarm, to break free of the Creep controlling them. The Zerg Civil War threatened to interrupt his plan, but the threat was ended in time for the leadership to be passed on. Well, he was a good guy all along. Who would have thought?