Apparently, as explained by Rashi, the Jewish army was commanded not to engage in total warfare; even against immoral nations, the humanity of the Israelite army required that we would not act as total savages, and therefore, effort must be made to preserve the fauna of a city that the Jews were attempting to destroy.
Read more