The Midianites - The Moabites are not included. It would thus seem that it was the Midianites, and they only, who deliberately set themselves to work the corruption of Israel.
Related Commentaries of Numbers 31:2
Numbers 31:2
2 Avenge the children of Israel of the Midianites: afterward shalt thou be gathered unto thy people.