The cause of Divergence is tricky - the book presents a genetic factor, but the factions are ultimately based on personality traits. It's the age-old question of nurture vs. nature.
If it's because of genetics, then that would mean personality is genetic and hereditary (nature). Or do you develop personality and personal values based on experience and how you were raised (nurture)?
As far as the government having good intentions, the government worked so hard for the society to be a success. As Tris said in the beginning, everyone knew where they belongs. People are contributing to the betterment of society as a whole, and that is good. Divergence can definitely threaten that because what happens when you've got someone who doesn't value the same thing as everyone else around them? What happens when they start challenging authority and the way things are? The government had good intentions to protect its people, but its actions spoke differently.