Genocide in the Bible

So in the Bible, God commands the Israelites to wipe out the Canaanites and the Amalekites on the grounds of paganism and their hostility towards the Israelites. But if you observe closely, then you'd discover that their hostility was justified on the grounds that the Israelites wanted to seize their land for themselves as well as commit genocide on them. Not to mention that the Israelites on several occasions were shown to fall into the same pagan practices as those other ethnic groups and at one point in 2 Kings 21:9 were described as more "wicked" than they were. Yet the Abrahamic God eventually redeemed them. If he could do this for the Israelites, then why couldn't he be bothered to do the same for the other peoples? Now I'm not saying that the pagan ethnic groups were not innocent either but that doesn't justify genocide. We've seen this play out today in Palestine where the Jews claim that God promised them the land so they're justified in doing whatever they wanted to them along with European colonization of various lands. This just shows you how the Abrahamic concept of God is built off of outdated tribal concepts. I still believe in God but he is not an egoist to the point that he would punish you for eternity for not following him. Nor is he a cruel deity to the point where he would command you to do his job for him. Let God do his own killing. Religion sure helps one to justify atrocious acts.