Gaeta and Zarek became randomly, suddenly evil because a Crimson Tide-esque mutiny would make for exciting TV.
Zarek had been jockeying to be the leader since he got out of prison the show, even trying to kill several characters a few times. Gaeta had gone through hell, he worked to the Cylon controlled government while on New Caprica but was a secret spy and would get information to the resistance. For his trouble, he was almost executed by the people he thought he was helping. Later, several of those people were revealed to be Cylons, one of whom was responsible for him losing a leg, and his commanding officer had accepted an alliance with the very Cylons who he had seen kill several thousand innocent victims on New Caprica. It makes sense that he wouldn't be happy and would be willing to do anything to prevent what he saw as an attempt for those Cylons to wipe out the Fleet. He had also seen Dualla kill herself, they were shown to be friends on some level. So he had been through a very rough patch. He clearly wanted to not kill anyone and keep it as clean as possible, while Zarek went around having people killed. He thought he was doing the right thing, but it turned bad and he got a bullet in his head. His biggest mistake was working with Zarek.