Sorry, where does science prove that killing a whole population is immoral?
Science can tell us the results of killing a whole population, but it can't make the jump to whether that outcome is ethically desireable, or whether the behavior is moral.
If we think of it in terms of health and well-being for conscious creatures, I hope it becomes clearer.
Gassing people, especially whole arbitrary populations of people, is NOT good for their health and well-being.
It's not even good for those not being gassed: They would be breaking ties with friends, partners, customers, etc.
It's not good for the leaders in power, making these orders, because:
1. They're losing tremendous number of assets and allies within their now dead population.
2. Those who lost their friends, partners, customers, etc. would be really mad at the leaders for that. (Even if they agreed with the plan at first, they would soon realize its true implications.)
3. The rest of the world values conscious creatures so highly (and, we can understand the scientific reasons why), that their reign would be seen as "evil".
4. The perceived benefits were imaginery, to begin with. For example: The "master race" ideal is not scientifically valid. Arguments about resource-handling ignore the fact that technology can provide better solutions than killing people, etc.
ALL OF THAT was ALREADY KNOWN by most people, through science, before the gassing started.
Those who thought otherwise were delusional. And, science can even shed light on how and why their delusions developed and came to power.