Do you believe the children of Amalek and the children of Jericho deserved to be slaughtered?
I wasn’t there. But the record we have states there was some warning (even from Balaam and others like him), and Amalek had a history of aggression towards the Israelites, attacking them at Rephidim and slaughtering a number of them while they were disadvantaged due to being tired out. Only the Gibeonites had the mind of submitting rather than meeting the Israelites in battle.