The breaking of the legs hastened death by bringing on asphyxiation rapidly. Crucifixion involves a lot of physical pain, scourging and often being nailed to the cross (rather than just tied). But the real manner of death was to stretch out the arms of the man on the cross and have the weight of his body drag him down. This weakened the muscles of the arms and chest and breathing became shallower. For a while a person could push up with his legs and take some of the weight off the arms and chest, which would prolong life and lead to deeper breathing. But eventually the lungs filled with fluid, breathing was labored and asphyxiation caused death. To break the legs removed the option of alleviating the arms and chest and death came much sooner.
As for Jesus, his legs were not broken because he had already died. That is the practical reason.
According to the Gospel of John: “For this happened so that the scripture passage might be fulfilled: ‘Not a bone of it will be broken.’ ” (19:36). John thus sees the fact that Jesus’ bones were not broken as a fulfillment of Psalm 34 and its Messianic reference to the just man: “[The Lord] watches over all his bones; / not one of them shall be broken” (Ps 34:21). It was also said of the Paschal Lamb, “You shall not break any of its bones” (Ex 12:46). Thus Jesus is the Lamb of God who takes away the sins of the world; as the Paschal Lamb for us, none of his bones are broken.