Stop being coy. Do you mean to say that the genocide was worth it because it stopped the worship of other gods?
I'm not being coy. I'm looking to see if you actually understand there is a 'why' beyond them 'merely' being pagans.
The Perrizites, Jebusites, Canaanites, etc, followed abhorrent practices, and this was explicitly part of why God was having Israel either destroy them or drive them out. What were these practices?
Oh, just things like
sacrificing their children to idols.
And not 'just' sacrificing them, the way they did it was pretty horrific too. They'd build an idol in the form of a brass or bronze statue, seated, with its arms stretched out over its lap. Then they'd light a fire inside of the idol, so that it was just about glowing hot.
Then they'd put a child into the arms, and have it slowly burn to death.
About eighty years ago, we had war crimes trials punishing people for less terrible things, and the sentence for that was almost always death.
God giving the land to the Israelites wasn't merely a matter of Him fulfilling a promise to the descendants of Abraham, it was also a matter of meting out punishment for centuries of unrepentant sin on the part of the people driven out. You can argue that you don't think the crime merited the punishment, but it happened for a
reason, and to try to remove it from the context of those horrific reasons is dishonest.