Problem: Moses had commanded the armies of Israel about their enemy’s land saying, “You shall not destroy its trees” (Deut. 20:19). However, here in 2 Kings they were instructed to “cut down every good tree.”
Solution: Some scholars believe that the Deuteronomy law applies only to using fruit trees for siege-works, since it says “do not cut them down to use in the siege” (Deut. 20:19). This fits with the fact that Deuteronomy explicitly states that the reason for not destroying fruit trees was that “the tree of the field is man’s food” (Deut. 20:19).
It is also possible that the command not to destroy them applies only to the land of the Canaanites which they would immediately occupy, whereas 2 Kings refers to destroying Moab which they were not going to occupy.