There are several instances where the Torah expects human beings to treat inanimate objects with the dignity of a human being. Most famous, perhaps, is when Moshe Rabbeinu refused to smite the water to initiate the plague of blood, out of gratitude to the water for playing a part in saving his life when he was a baby. Likewise, one of the reasons we cover the bread during Kiddush, is so as not to embarrass the bread when we say the blessing of "hagafen" before its blessing, "hamotzi." The Torah wants us to practice, as it were, good character traits with such objects so that when we encounter human beings we will be more fine tuned to act with gratitude and respect.
In Parshat Mishpatim, we find similar examples, but here it is in the context of animals. We are told that the carcass of an animal which cannot be eaten should be thrown to the dogs. The Midrash explains that this is to show gratitude to the dogs for not barking during the plague of the smiting of the first born in Egypt. We are also told that if one encounters his enemy's animal that is carrying a heavy load, one is obligated to help ease the pain of the animal and help his fellow unload the burden. The Sefer HaChinuch, in his commentary on this command, writes that it goes without saying that one must display compassion for a human being who is experiencing pain. Animals are living creatures and the Torah wants us to treat them with compassion, but this treatment, like that of Moshe towards the water and us towards the challah, is also meant to train us to treat our fellow human beings with at least the same level of compassion.
Rabbi Michael Macks will be contributing weekly divrei torah as he is able