That’s what I’ve always been taught. Dogs need to stop and sense the smells out there. It’s one way of knowing where they are, if in a familiar area, and their way of telling whether other dogs have been there. Besides, male dogs urinate to mark their territory, hence, why they lift a leg instead of kneeling both hind legs once puberty sets in.
And to the human owner: Don’t discount the walk you’re getting as “not exercise”, because even strolling along to the dogs’ tempo has its health benefits.