The origins of human bipedalism (ie walking on two legs) are intriguing.
It is still commonly asserted and accepted that our species’ bipedalism began when our distant and more ape-like ancestors descended from the trees, left the forests that are still home to all other apes and began foraging in the open country, or savannah. Hence this idea is commonly called ’savannah theory’.
It has been set out elsewhere:  ,  , and there is no need to detail it further here. However, there are numerous problems with savannah theory, and it appears to be foundering. It does not explain many aspects of human anatomy and and physiology with the ease displayed by the Hardy-Morgan aquatic hypothesis . That one is commonly known as the Aquatic Ape Theory (AAT), and appears to be steadily gaining ground. It is in my view at present the best theory of the origins of bipedalism.
A full list of the human anatomical and physiological features it does explain, and explains well, is to be found in The Aquatic Ape: A theory of human evolution by Elaine Morgan (Souvenir, London, 1982)  , . However, arguably the greatest weakness of savannah and related theories would appear to be the anomalous absence of well-developed night vision in humans, as distinct from that displayed by all other savannah-dwelling species. The latter include the herbivores of the African and Asian savannahs such as ruminants  (’cattle, goats, sheep, giraffes, American Bison, European bison, yaks, water buffalo, deer, camels, alpacas, llamas, wildebeest, antelope, pronghorn, and nilgai’) and the odd-toed ungulates such as the zebra and tapir. The predators on all these species, particularly cat and dog-related species of the order Carnivora  all have excellent night vision, commonly involving a reflective tissue layer in the back of the eye known as the tapetum lucidum, responsible for the phenomenon of ‘eyeshine’ in dogs, cats, cattle and other animals.
So how did our ancstors ever survive without it? The above-mentioned savannah dwelling species that are commonly the prey of night-roaming carnivores like lions, leopards and wolves need good night vision. If we arose as a savannah-invading species, we are out of step with all the rest of the savannah dwellers in regard to a most vital ability.
Bipedalism lengthens the legs in relation to the arms. In chimpanzees for example, the arms are longer than the legs, while in humans the reverse is the case. This improves humans’ ability to cover ground fast by running, and to wade and swim, but reduces their ability to escape predation by climbing trees; that is, even if on the open savannah such are available. The lack of similar night vision to that of the predator increases one’s likelihood of becoming that predator’s next meal.
Baboons (the other major ground-dwelling primate on the African savannah) shelter at night in trees. Their bodies are lighter than the leopards’, and they can easily climb out of reach. (With their long canine teeth, a team of alpha male baboons on the ground can readily see off a leopard.)
That most interesting species, the Hamadryas baboon  camps at night on top of or on the faces of rocky cliffs, and zoo enclosures for these animals commonly cater for this need.
This raises the intriguing possibility that before the discovery of fire and the invention of the thorn-fenced kraal, our distant African ancestors attained their relatively longer legs by wading, swimming and climbing for shelter at night up or down rocky cliffs, bluffs and outcrops, where long non-grasping legs provide no great disadvantage. For the climbing of trees, they do. Getting to where the predators cannot reach you makes poor night vision less of a disadvantage.
This points to rocky coastal, lake and river shores as being likely sanctuaries for early humans: providing places humans could climb up or down to, but not accessible to those animals inclined to prey upon them. Bodies of water conceivably provided additional barriers to the predators. The discovery of fire post-dates bipedalism, and this and developed fencing technique would have provided enhanced night-time security.
But if you cannot survive at night, you cannot survive at all.
We may also ask, why did we start using fire? It is certainly useful for keeping warm on cold nights and for warding off unwelcome animals, but carried as a small continuously burning flame on the end of a stick or small bunch of sticks, it compensates for our collective night-vision deficiency.