John Calvin's Bible Commentary
Joshua 10:18
18.And Joshua said, Roll, etc The enemy having been completely routed, Joshua is now free, and, as it were, at leisure, to inflict punishment on the kings. In considering this, the divine command must always be kept in view. But for this it would argue boundless arrogance and barbarous atrocity to trample on the necks of kings, and hang up their dead bodies on gibbets. It is certain that they had lately been raised by divine agency to a sacred dignity, and placed on a royal throne. It would therefore have been contrary to the feelings of humanity to exult in their ignominy, had not God so ordered it. But as such was his pleasure, it behooves us to acquiesce in his decision, without presuming to inquire why he was so severe.
At the same time, we must recollect, as I formerly hinted, first, that all from the least even to the greatest were deserving of death, because their iniquity had reached the highest pitch, and the kings, as more criminal than the others, deserved severer punishment; and secondly, that it was expedient to give an example of inexorable rigor in the person of the kings, whom the people, from a perverse affectation of clemency, might have been too much disposed to pardon. It was the will of God that all should be destroyed, and he had imposed the execution of this sentence on his people. Had he not stimulated them strongly to the performance of it, they might have found specious pretexts for giving pardon. But a mercy which impairs the authority of God at the will of man, is detestable. (102) Now, however, when regal honor is not spared, all handle for humanity to the plebeians and common vulgar is cut off.
By this instance, the Lord shows us the great interest he takes in his elect people; for it was an instance of rare condescension to place kings under their feet, and allow them to insult over their dignity, as if they had been petty robbers; as it is said in the Psalm, A two-edged sword is in their hand to execute vengeance on the nations, to bind their kings with fetters, and their nobles with chains of iron; to execute the judgment written: this honor have all the saints. (Psalms 149:6) That fearful sight had at the same time the effect of striking terror, so as to prevent the Israelites from imitating the manners of nations whose crimes they had seen so severely punished. Accordingly, we repeatedly meet in the books of Moses with this warning, You have seen how God took vengeance on the nations who were in the land of Canaan before you. Beware, therefore, of provoking the wrath of your God by their perverse doings. In one word, that God might be worshipped with greater sanctity, he ordered the land to be purged of all pollutions, and as the inhabitants had been excessively wicked, he willed that his curse should rest upon them in a new and unwonted manner.