The whole system can be seen as a metaphor for high-school cliques. When you enter high school, you can choose to completely change who you are to join a more preferable clique, as long as you act they way the other kids in it want you to act.
Chicago's society seemed to have pretty big problems, mainly the ever growing numbers of disenfranchised "factionless". It makes sense in retrospect when you realize that the ruling party were Abnegation who were *not* the faction known for their brains, who likely saw the problem but couldn't see a way out of it. Similarly, the Erudites were actively plotting to take over, and so would have been disinclined to provide a solution to Abnegation
Why are so many of the Erudites so morally corrupt? Because while other Factions are based on specific virtues (Selflessness, Kindness, etc...), Euridite is a Faction that centers on knowledge, which isn't necessarily a type of personality aspect that would so bounded towards teaching high morals.
Divergents may be rare, but Tris being one in particular isn't all that surprising. If factions are determined by genetic defects, then the Prior family is basically the perfect gene pool to counteract it. Tris's parents are eventually revealed to both be transfers from other factions (Dauntless and Erudite respectively). So Tris has close blood relations to a whopping three factions when most people in her society are only linked to one. Is it any wonder that she and Caleb both left Abnegation?
The worldbuilding is pretty vague and the social caste system in the society is rather simplistic and one-dimensional. Might be Fridge Brilliance in that the whole point of the story is to tear down such a system and demonstrate why it would not work.
Also makes a bit more sense when Allegiant reveals that their entire system was set up by a government group, which is still actively working to keep the faction system going through subtle interference and the occasional mass memory wipe.
Though as this video explains, the fact that the society ran (or even formed) at at all is extremely unlikely, if not outright impossible. Considering that the city seems to lack essential workers. Ask yourself this when it comes to the society: Who cooks the food? Who makes the clothes? Who cleans up the city? Who powers and maintains the equipment? Who maintains the sewage? Are there any plumbers? It's never explained.