Is this allegorical?
Deuteronomy 20
When you draw near a city to attack it, offer it terms of peace. If it agrees to your terms of peace and lets you in, all the people to be found in it shall serve you in forced labor. But if it refuses to make peace with you and instead joins battle with you, lay siege to it, and when the LORD, your God, delivers it into your power, put every male in it to the sword; but the women and children and livestock and anything else in the city—all its spoil—you may take as plunder for yourselves, and you may enjoy this spoil of your enemies, which the LORD, your God, has given you.That is how you shall deal with any city at a considerable distance from you, which does not belong to these nations here. But in the cities of these peoples that the LORD, your God, is giving you as a heritage, you shall not leave a single soul alive.
Hosea 1
for in a little while I will punish the house of Jehu for the bloodshed at Jezreel and bring to an end the kingdom of the house of Israel;
compare this to 2 kings 9
Jehu got up and went into the house. Then the prophet’s aide poured the oil on his head and said, “Thus says the LORD, the God of Israel: I anoint you king over the people of the LORD, over Israel. You shall destroy the house of Ahab your master; thus will I avenge the blood of my servants the prophets, and the blood of all the other servants of the LORD shed by Jezebel. The whole house of Ahab shall perish: I will cut off from Ahab’s line every male, whether bond or free in Israel. I will make the house of Ahab like that of Jeroboam, son of Nebat, and like that of Baasha, son of Ahijah. In the confines of Jezreel, the dogs shall devour Jezebel so that no one can bury her.” Then he opened the door and fled.
God commanded them to shed blood at Jezreel but now they are punished for doing what God commanded them?
This can be explained away by allegory?