What factors of anthropogenesis ensured the development of upright posture?

To date, there is no unequivocal evidence in this regard. There is a set of hypotheses, each of which has its own justifications and, on the whole, do not contradict each other. For instance:
1) Bipedalism as an adaptation to life in the savannah. The ability to see far is of great importance both for salvation from predators and for finding food.
2) The ability to store food supplies and carry them with you could give a significant advantage, especially in combination with a social lifestyle, with the division of labor.
3) What is important is the difference between humans and other animals – the ability to run long in hot climates. Perhaps this was the initial factor and the selection began to support changes conducive to fast running. At the same time, “redoing” multifunctional arms, adapted for climbing and grabbing objects into “running” ones, may have turned out to be more difficult than to straighten the body by adjusting the lower limbs for running. We see a similar development in birds (lizards) – the wings did not become legs again in ostriches.
There are other considerations, for example, that a straightened body is heated less by the sun (the illuminated body area is much smaller than that of tetrapods), and cooling is better, since the wind is significantly weakened in the surface layer of air.

Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.