To limit the probability of an inability to resist expected gravity loads, which could lead to buckling in the plane of walls.
For walls supporting floors, this is to limit the probability of compromised structural integrity, which could lead to excessive movement, vibration or deflection, which could lead to negative effects on the psychological well-being of persons.