And the Lord said unto Moses
Being provoked with the sins of the people, he called to him out of the tabernacle, or out of the cloud:
take all the heads of the people,
the princes of the tribes, not to hang them, but to judge those that worshipped Peor, as Jarchi interprets it; though some think that these having sinned, were ordered to be taken and hanged, and made public examples of; but it can hardly be thought, though there were some that might be guilty of the above sins, as Zimri, yet not all of them:
hang them up before the Lord against the sun;
that is, those that were guilty of idolatry: the meaning is, and which all the Targums give into, that these heads of the people were to assemble at some proper place, the court of judicature, and order the delinquents to be brought before them, and try, judge, and condemn those they found guilty, and cause them to be hanged somewhere near the tabernacle, and before it, having neglected the worship of God there, and served an idol; and this was to be done openly in the daytime, that all might see and fear; and if it was the sun that was worshipped in this idol, as some think, they were hanged against the sun, to show that the idol they worshipped was not able to deliver them; but, in the face of it, and as it were in defiance of it, they were ordered to be hanged up; and this, according to the Targum of Jonathan, was in the morning against the rising sun, and where they hung all day, and were taken down at sun setting:
that the fierce anger of the Lord may be turned away from Israel;
when justice had taken place, and proper punishment was inflicted upon the criminals, whereby a just resentment was made against sin, and God glorified.