Men and women do indeed walk differently. Although exceptions exist, for the most part, the two genders have distinct walking styles. The main contributing factors include the different body types of structures of men and women.
Men, for the most part are larger than women; their bodies are built for physical work. Walking for men, from a physiological stand point, is utilitarian. The purpose of walking is to achieve a specific function, get from place to place. As such, the walking movements of men tend to be straight and linear. Women tend to move more gracefully, swinging their hips and taking shorter "feminine" steps. The legs rarely go very far apart in long strides, even when walking swiftly. Women still walk to get from point a to point b, but their movements and walking style are influenced by years of evolution. From an evolutionary standpoint, walking style for women has served to attract men and get a mate.
The kinds of shoes that men and women wear also influence the way they walk. For example, men who wear work boots will have added bulky weight on their feet. This results in a sloppier walk with less precision and control. Women who wear high heels would find it difficult to walk in heels if they did not control the exact movements of each step.
Walking style also influences the entire body. The movements of the body are subtle, but there is a discernible difference in men and women. Men tend to take larger strides and walk with their legs farther apart. This results in more side to side movement, which may be why men are more prone to move their arms and shoulders when they walk then women. Women tend to take shorter strides and keep their legs closer together. This results in less side to side movement and more up and down bobbing.
Research at the University of California-Los Angeles, New York University and Texas A&M University found that the sexuality of a person will also influence the way they walk. Men who are gay will tend to adopt more feminine movements, such as hip swaying. Women who are lesbians will adopt more masculine movements, such as wide strides.