To say something is deserving of compassion is more relative to the suffering and misfortune of an entity. Suffering and being able to perceive misfortune comes from being conscious and having a degree of subjectivity. So if something isn’t able to suffer or be aware of its own misfortune, it is not particularly rational to feel compassion for it.
Whether we as a society would like to attribute rights to something that isn’t capable of suffering or percieving its own misfortune is left up to consensus even if it’s irrational in this way.
The feeling of empathy, as defined by the Webster dictionary is the imaginative projection of a subjective state into an object so that the object appears to be infused with it, is another case. We humans and many other animals are predisposed to and will likely feel empathy for things that have relatable characteristics. The problem with using empathy to dictate a course of moral judgment is that characteristics such as self-propelled movement, vision, hearing, etc. could be said to have moral significance and anything that does harm to anything with those characteristics could be said to be immoral when those are things that modern-day robots and computers can even do. Sure, one can certainly hold the opinion that causing harm to those things is immoral, but I think it would be unlikely that when push comes to shove one would attribute moral consideration to something like a laptop or even cellular life. You could pose the questions of whether life is deserving of rights or if doing harm to life should be deemed immoral. Homeostasis, organization, metabolism, growth, adaptation, response to stimuli, reproduction, all of these things I personally can't imagine most people genuinely or seriously care about enough to attribute moral significance in terms of doing harm to them, for example, cutting down trees, mowing grass, cutting your hair, having organs and tissue disposed of after surgery, just to name a few. I would think that the one thing most people probably care about and can agree on is that if an entity currently possesses the capability of suffering and perceptive misfortune it then should be given moral significance.