There is a famous screenwriting manual called “save the cat” suggesting that your character should do something nice like that so the audience will like them. The inspiration is Ripley in “Alien” saving the ship’s cat.
My theory on why Ripley saves the cat is different.
The cat is the only creature on the ship who’s not a moron except Ripley. The rest of the crew all disqualify themselves when the question arises if the away team with the infected crew member should be allowed back on the ship. Ripley is the only one who’s trying to do the right thing here while the rest of the crew are dooming themselves by disagreeing and overriding Ripley’s order.
Had Ripley succeeded at that point and not let the away team back on the ship, most everybody would have lived.
Ripley doesn’t save the cat to make a nice impression on the viewer (it’s much too late in the movie for that) but because the cat is innocent. The cat deserves to live. Everybody else was an asshole.