Why did some animals evolve inward-slanted legs?
Sorry no references other than illustrations for the moment.
If a running biped has it's feet further away from the line of gravity, then it's got less efficiency in forwards motion and more instability of the line of gravity falling left and right.
When you consider the kinetic downwards weight in kilos that goes into every step, a runner/sprinter who doesn't have aligned steps wastes a lot of energy.
here's are dinosaur footprints:
https://australianmuseum.net.au/Uploads/Images/7919/footprint%20comparisons_big.jpg
The hips joints tend to point sideways to give a strong musculature, lots of running muscle, and a wide base of more than 90 degrees, for a wide birth canal and other reasons.
So the tendency for efficiency of running bipeds is to have aligned footsteps and their hips tend to be a strong and wide base.
That's only the resting position, the walking angles actually vary a bit outwards and straight too, the knee goes outwards when it's rising.
https://cdn.pixabay.com/photo/2016/01/18/02/04/footprints-1145883_960_720.jpg
here is a comparison of ostrich and human bone angles: http://rsif.royalsocietypublishing.org/content/13/122/20160529