You appear to confuse stories where these things occurred with encouragement for them.
And the LORD spake unto Moses, saying, Avenge the children of Israel of the Midianites .....Lots of bloodshed follows.......And the LORD spake unto Moses, saying, Take the sum of the prey that was taken, both of man and of beast.......And levy a tribute unto the Lord of the men of war which went out to battle: one soul of five hundred, both of the persons, and of the beeves, and of the asses, and of the sheep Take it of their half, and give it unto Eleazar the priest, for an heave offering of the LORD.
Look up what a heave offering is and what you would have to do to a person to do it, it's not pretty
That sounds like encouragement to me