Beating was a form of punishment used in Israel for various offenses. However the safety and personal dignity of the person being beaten was important to God even though he or she deserved the beating. These things were also to be important to God"s people. [source][source][source]
"This was the Egyptian mode of whipping, as we may see depicted upon the monuments, when the culprits lie flat upon the ground, and being held fast by the hands and feet, receive their strokes in the presence of the judge.... The number forty was not to be exceeded, because a larger number of strokes with a stick would not only endanger health and life, but disgrace the man.... If he had deserved a severer punishment, he was to be executed.... The number, forty, was probably chosen with reference to its symbolical significance, which it had derived from Gen. vii12onwards, as the full measure of judgment. The Rabbins fixed the number at forty save one (vid. 2Cor. xi24), from a scrupulous fear of transgressing the letter of the law, in case a mistake should be made in the counting; yet they felt no conscientious scruples about using a whip of twisted thongs instead of a stick." [1][source]Deuteronomy 25:1 points out very clearly that "justify" means to declare righteous, not to make righteous. This distinction is very important to a correct understanding of the doctrine of justification as God has revealed it in Scripture. Generally speaking the Protestant Reformers failed to express this distinction clearly. To combat the Roman Catholic charge that justification by faith alone leads to antinomianism, some of them went beyond the proper definition of justification and taught that the justified believer will inevitably persevere in faith and good works. [2][source]