Governments use coercion to aggregate distributed information relevant to governmental objectives –from the prosecution of regime-stability threats to terrorism or epidemics–. A cohesive social structure facilitates this task, as reliable information will often come from friends and acquaintances. A cohesive citizenry can more easily exercise collective action to resist such coercion, however. We present an equilibrium theory where this tension mediates the joint determination of social structure and civil liberties. We show that segregation and unequal treatment sustain each other as coordination failures: citizens choose to segregate along the lines of an arbitrary trait only when the government exercises unequal treatment as a function of the trait, and the government engages in unequal treatment only when citizens choose to segregate based on the trait. We characterize when unequal treatment against a minority or a majority can be sustained, and how equilibrium social cohesiveness and civil liberties respond to the arrival of widespread surveillance technologies, shocks to collective perceptions about the likelihood of threats or the importance of privacy, or to community norms such as codes of silence.