This seems to be the answer to Dovid HaMelech. When he went to war, it was in the manner that Hashem directed him. Hashem designed the human and understands the delicate balance within him: what affects him and how. Hashem commanded us to make use of certain behaviors, in certain measures, and at certain times. The same act when done for the wrong reason will be disastrous to the person. However, when it’s done for the right reasons, in the right measure, it will not harm him. Dovid remained pure and unsullied because he followed the Torah’s system of self-perfection, designed by the only One who truly understands the nature of the human.
This seems to be the answer to the Sefer HaChinuch as well. The Torah isn’t concerned about the pain of the animal; it is concerned about man. Man is the reason for creation. Everything in existence was formed to serve him. However, man was fashioned in a delicate balance. If he uses this world for its intended purpose, in the right way, in the right time, then he grows and perfects himself. However, if he uses the world incorrectly, in the wrong manner, or to the wrong extent, he is damaged by that process.
The act of killing a mother and child is akin to wiping out generations; it is pitiless and cruel. Hashem, Who understands the balance and nature of man, has told us that killing an animal for good use will not lead you to a hardened nature, provided you do so within the given boundaries. Remain within the system and you are safe. Leave these guidelines and you are in grave danger.
This concept is very applicable as it helps us appreciate the wisdom of the Torah’s system for growth. There is much that modern man understands about the inner workings of the human, and there is at least as much, if not more, that he doesn’t understand. Hashem has designed us and has given us the guidebook for perfection. It is our job to follow the Torah’s directives in the right balance, in the right time, in the right manner, thereby actualizing our potential as the reason for all of creation.