A simple answer to this question is that Maimonides felt that G-d never instructed Israel which was contrary to our state of development at that time. This could be applied to gunpowder and is applied to animal sacrifices, in which he felt that G-d did not want nor need but that people felt that this was the best way of worship. See Ben Shapiro regarding this. Now to the long answer.
Although the Torah commands to conquer Canaan, Moshe Rabbeinu sought peace, which was the true goal of the Torah. The Torah teaches to treat non-Jews fairly, as we ourselves were once slaves in a foreign land. More than forty times Israel is commanded to love its neighbors. See (Leviticus 25:35). Rabban Yochanan ben Zakkai gave blessings of peace even to pagans. See (Berakhot 17a). And Rabban Gamliel passed out bread to a pagan he never knew simply because he was in need of food. Refer to (Eruvin 64b). We are even encouraged to visit non-Jews and pray when they are ill. (Shulchan Aruch, Yoreh Deah 151:12) and (Tosefta Gittin 3:13).
Thus, G-d, who is transcendent, would not reveal gunpowder (which will be invented a few thousand years later by the Chinese in the 9th-century). True, the Torah demands the conquest of Canaan, but Moshe saw that Torah's ultimate purpose was peace, and realized that this was placed because Israel needed to hear the call to arms at that time, but when a close examination is applied, we find that Joshua never "conquered" or destroyed the inhabitants of the Canaanites against their will but gave three options, a) leave peacefully, b) convert, or c) fight. While some chose to fight out of free will, we cannot call this a genocide as the land was promised to Abraham and his descendants, and Joshua proposed a peaceful solution. To call this an act of aggression or genocide, you can not.
PS the term "genocide" was invented only a long time later, and no one regarded the Bible as a "book of genocide." Not to mention that the word genocide and the concept of genocide is alien in the Hebrew language of the Torah. Thus, there was no need to reveal gunpowder. And if there were, one could speculate why not reveal nuclear power or biological weapons. Because the goal of Torah is peace, not war.