Whenever they went out to war, the hand of Yahweh was against them for evil, as Yahweh had spoken and as Yahweh had sworn to them, and they were greatly distressed.
“for evil.” Here, “evil” is describing bad things, disaster.
“as Yahweh had spoken.” God had said that if Israel forsook God they would be destroyed (cp. Deut. 6:15; 7:4).