It's less jarring to walk beside someone in the same step, since they don't bounce up and down relative to you, so there is also a pure visual comfort in it.
And it's not just walking. Mimicking someone is a natural way of showing closeness. For instance, when coworkers greet each other, the second one often matches the first one's tone.