Deuteronomy 21:9

9 and thou dost put away the innocent blood out of thy midst, for thou dost that which [is] right in the eyes of Jehovah.

Deuteronomy 21:9 Meaning and Commentary

Deuteronomy 21:9

So shalt thou put away the guilt of innocent blood from among
you
Which otherwise, the person not being found out, and brought to just punishment for it, would devolve upon the whole. Aben Ezra interprets it the punishment of innocent blood, which, by the above method being taken, would not be inflicted on them:

when thou shalt do that which is right in the sight of the Lord;
as it was to observe this law concerning the beheading of the heifer, with all the rites and ceremonies belonging to it here enjoined; as well as every other command, statute, and ordinance of the Lord, which are all right to be done, ( Psalms 19:8 ) .

Deuteronomy 21:9 In-Context

7 and they have answered and said, Our hands have not shed this blood, and our eyes have not seen --
8 receive atonement for Thy people Israel, whom Thou hast ransomed, O Jehovah, and suffer not innocent blood in the midst of Thy people Israel; and the blood hath been pardoned to them,
9 and thou dost put away the innocent blood out of thy midst, for thou dost that which [is] right in the eyes of Jehovah.
10 `When thou goest out to battle against thine enemies, and Jehovah thy God hath given them into thy hand, and thou hast taken captive its captivity,
11 and hast seen in the captivity a woman of fair form, and hast delighted in her, and hast taken to thee for a wife,
Young's Literal Translation is in the public domain.