Any questions or doubts regarding God's command for the genocide of the Canaanites ultimately boils down to another, much more common question:
Is the presence of evil and suffering in the world consistent with the just and loving natures of God?We know that God is sovereign - that is, He answers to no authority and no principle except His own nature, nor can He be compelled to do anything that is against His nature. Asking if God can sin (or for that matter, if He can make a rock so heavy He can't lift it) is akin to asking if the forces of gravity can lift a rock upward from the surface of the Earth - yes, but the seemingly impossible feat would have been the result of an even stronger gravitational field that is not seen by us. Similarly, God may do something that appears to be contradictory to His nature, but ultimately, due to our understanding of the sovereignty of God (that is, no motivation other than His nature can exist for God), there necessarily exists indirect reasons that are rooted in His nature.
Having established the sovereignty of an omniscient, omnipotent God, we can see that there is no qualitative difference between God commanding genocides and God permitting genocides such as the one attempted by Hitler. Thus, this question reduces to the age-old Problem of Evil, and enough has already been written on this topic.
From a Christian perspective (and I know many in this forum are not), God is the ultimate authority because of His omnipotence, and His status as the creator of all that exists. It is conceivable, therefore, that God would have created the world according to the values and moralities that He holds - since there exists no other standard to which He would have any reason to adhere to. We can thus see that if our own ethical systems differ from the one held by God and described in His Inerrant Word, it is us who are wrong, and not God. Any actions by God, therefore, is factually morally correct and ought to be perceived as morally correct, because God is acting using the same morality to conduct all His actions as the morality He had built into the very fabric of the universe and within our own human natures. Any perceived discrepancy can be attributed to the latter being distorted, directly or indirectly, by the Fall of Man.
It must also be clarified that God is not a "fair" God, despite being a just God. The Calvinist principle of Unconditional Election makes this very clear - God does not choose His Elect based on any system comprehensible to us humans. Romans 23:3-4 reads:
[F]or all have sinned and fall short of the glory of God, and all are justified freely by His grace through the redemption that came by Christ Jesus.
Saving grace is from God and God alone, and no one is any more worthy of salvation, or a long and fulfilling life for that matter, than anyone else.
Furthermore, it is written in Isaiah 45:9:
“Woe to those who quarrel with their Maker, those who are nothing but potsherds among the potsherds on the ground. Does the clay say to the potter, ‘What are you making?’ Does your work say, ‘The potter has no hands’?
It ought to be noted that these are scriptural quotations, and are non-negotiable fundamental doctrines of the Christian faith. The Isaiah verse clearly precludes any argument by the dead Canaanites who come before God to be judged - what right does the clay have to complain to the potter? They do not deserve long, fulfilling lives any more than a kind and loving non-Christian deserves to enter heaven. God hands out the blessings of eternal life and justification through Christ solely at His discretion, and His application of the blessing of a long, pleasant life does not appear any less random to human eyes. This attests to the sovereignty of the Lord more than anything else.
Nor can any creation claim injustice in that it never chose to be created - a state of non-existence is not equivalent to a neutral emotional state, and and anything that may happen to any of us while on this Earth, or even being placed eternally in hell (a fate deserved by all humans, Christian or not), represents neither an improvement nor a deterioration from non-existence. Eternal salvation, on the other hand, represents a definite improvement over the aforementioned, otherwise unavoidable and fully justified fate, and that is the foundation of the Christian faith, and the proof of God's love.