Think e.g. of the Ising model. You may think of the "spins" as describing a distortion of the unit cell, which may distort in either of two directions. The energy gained by a collective distortion = parallel alignment of N spins is of the order U=-N J where J is the spin spin interaction energy. On the other hand a completely disordered state has an entropy of S= k ln N while an ordered state has S=0.
The relevant quantity is the free energy F=U-TS. At T=0 the ordered state will be more stable however at some critical temperature, the S term will outweigh the U term and the symmetric state with <S_z>=0 will be favoured.