It's easy to look at a video like this and attribute it to stereotypes of the behavior of crowds in different countries. I think the overlooked thing is that lines in Japan are very often actively managed. If a new line opens up, very often there is a person standing by the ropes guiding people to the new opening in a fair way. If the ropes are too long (causing you to go back and forth unnaturally) there is a peson there who removes them and creates a short-cut. Similarly, they will add ropes or move the line into a better position or manage a 'cut' in the line when it passes in front of a doorway or path (like in the video).
This puts you at ease since you know there is an authority figure watching out for fairness. Its no longer a "me first" attitude. It also trains people on how to behave when in a line. When that authority figure is not there, people still adopt the conventions of when they are.
In summary, this kind of behavior is taught and socialized into people because it's valued. In America (where I'm from) it is considered inefficent to have a person standing by a line telling people what to do. People are expected to self-manage. This also means when you're waiting on a line in Japan, you're not really thinking about the line very much. You're free to talk, read or daydream without worrying about your place in line.