Stopping people from taking a walk or running outdoors has no direct benefit (because the risk of outdoor contagion in case of an airborne virus is pretty low). Moreover, it comes with hefty costs: people need ways to exercise and avoid feeling trapped in the house, and removing ways to fulfill those needs leads to poorer physical and mental health.
Hence, in general, stopping people from taking a walk or running outside is mostly bad policy.
However, there are a few limited exceptions.
When does it make sense to stop people from going outside?
It makes sense to prevent people from assembling at outdoor concerts or outdoor sports events when there is a risk that participants use indoor toilets.
That said, the preferred solution shouldn’t be to ban outdoor events but to enforce a masking policy for the use of toilets. Banning those events is justified only in the case of a population that cannot mask appropriately indoors during high viral spread.
Why did countries ban people from going outside?
Many countries did it with the purpose of blocking outdoor contagion, and that was mostly bad policy.
However, there is an argument for curfews, and that is preventing people from visiting each other. During the worst phases of a pandemic, it makes sense to ask people not to visit each other indoors because doing so would increase the spread. How can such a policy be enacted, though, especially in the context of a low-trust society? Obviously, we do not want the police to check inside our houses. Hence, why some governments instituted curfews.
To be clear, in a well-functioning society, there should be no need for curfews. People would reduce indoor contact, they would meet outdoors or use masks, and, in general, do whatever they reasonably can to keep the viral spread low. Curfews only make sense as a temporary last resort in a badly functioning society whose citizens aren’t able to keep spread low.