God told Moses to treat the Midianites as enemies and attack them because they had treated Israel like enemies with their deceitfulness.