Biography
Villains are evil. They kick dogs instead of petting them. What if they started petting one dog in particular, and thereby showed some kindness, sympathy, etc. other qualities not part of their villainous persona? That dog is the villain's morality pet.
These can be used when a villain becomes popular enough that the fandom becomes sympathetic to them. Thus, the author(s) want to use them more often and in more situations. However, meshing them into the main cast can be dangerous and disappointing if it leads to a Redemption Demotion. Some heroes wouldn't be quick to accept them, either. After all, they are villains.
One method of doing this is presenting another character to befriend them. Ideally, this should be an upbeat character who could pose no threat or even be demanding, and depending on how the plot goes, the recovering villain becomes fond of this other character and may draw stability from their presence. The Morality Pet may even be somewhat pathetic (and will be told so), but has often gone through some anguish to which the recovering villain can relate secretly, or reminds the villain of someone they lost long ago. If handled poorly, they might become a Satellite Character for the former villain.
This also makes for a convenient excuse to help the heroes if needed; an ex-villain can simply claim to have their own "selfish reasons" and save face. Anyone messing with the Morality Pet can expect swift retribution from the ex-villain or antihero in question. If relationship with the morality pet is familial in nature, then Mama Bear, Papa Wolf or Big Brother Instinct (as appropriate) is involved. Sometimes Violently Protective Girlfriend or its male inverse if the morality pet is a love interest.
They are a living and recurring incarnation of Pet the Dog, i.e. something to placate the audience regarding the hero's tolerance of the amoral character, while focusing on the true villains. (Unless they Kick the Morality Pet, that is, which leads their character arc in a different direction.)
This isn't just for villains, either. Despite sidekicks being less popular in comic books than they were originally, some writers pair them with Anti Heroes in an effort to humanize them.
Not to be confused with a magic-user's familiar, the creature type of which often reveals the kind of person who owns it, though if the magic-user is fond of the familiar and treats it well, it could very well be a Morality Pet.
If the Morality Pet dies or disappears and this causes the villain/anti-hero to revert back to their old ways, the Morality Pet was acting more like a Morality Chain, a similar trope often confused with this one. The difference between the two is subtle: A Morality Pet is a character who redeems a villain. The villain's affection for the pet starts them down the path of good, and even should the pet get hurt the villain will most likely behave as a hero (or anti-hero) in seeking their revenge or protecting the pet. By contrast, the Morality Chain keeps an otherwise anti-heroic character (such as a Sociopathic Hero) from going full villain. The loss of the chain would spell doom for any involved party, and likely anyone nearby as well. In a nutshell, a Morality Pet turns a bad guy good, a Morality Chain stops a good guy from turning bad. That said, the two tropes can certainly overlap, if the character redeems a villain and then also helps keep them from slipping back to evil, they are both a Morality Pet and a Morality Chain.
Or to put it another way: The Morality Pet is a catalyst for a Heel–Face Turn, while the Morality Chain is an inhibitor of a Face–Heel Turn. In this sense, the two are actually Opposite Tropes despite their close similarities.
Compare Predator Turned Protector, where their "pet" is the thing they're supposed to prey upon, and they act as full-blown protector rather than simply caring for/petting them.
Parent trope of Little Brother Is Watching. Can overlap with Even Evil Has Loved Ones.