The governor was killed in a battle with Rick and his group. His fate was sealed due to his own aggressive actions and the determination of the survivors to protect themselves.
The governor's demise in the comics comes as a result of his own hubris and the determination of those fighting against him. It's a climactic and fitting end for his character.