Well yeah. The goal is to humanize the person they just killed, to make the players potentially regret their murderhobo ways for a brief moment. And one of the fastest ways to make a character (at least shallowly) altruistic is to have them pet the dog. Do something kind for something/someone innocent. It’s often used to show that an antagonist isn’t entirely evil, and is acting against the party due to a specific goal (rather than simply being evil for evil’s sake).
It’s the inverse of the “kick the dog” trope, where a character does something obviously evil for no narrative purpose other than proving that they are evil.