It's because earths magnetic field is oriented in South to North direction (though little shifted from geometric North and South directions).
And any (other) magnet always try to align itself along external magnetic field direction. This is to have minimum possible potential energy of the system. And minimum energy is associated with stability.