I've previously suggested that only persons (roughly, beings with an enduring sense of self) are harmed by death. There are two ways that one might argue for this.
(1) One might appeal to a 'preference' view of welfare. On this view, beings are harmed by having their preferences thwarted (but not by the mere prevention of future preference formation and satisfaction). So if a being lacks future-directed preferences, depriving them of a future doesn't deprive them of anything they want, and hence does them no harm.
To reach the desired conclusion, we need to add a further premise: only persons (self-aware beings) can have future-directed desires. Other animals are, on this view, presumed to ultimately care only about their present happiness. As an empirical conjecture, this sounds implausible. But part of the difficulty is in attributing ultimate desires to animals at all. We can say of a person that they desire the candy as a means to pleasant gustatory sensations, but is animal eating behaviour similarly rationalizable in terms of any further goal? If not, do we really want to say that animals value eating non-instrumentally, as an end in itself? This seems to over-intellectualize what is going on. The philosophical use of 'preference' or 'desire' (as indicating an individual's ultimate values or concerns, on reflection) doesn't seem to apply to simple (non-rational) minds.
Even if animals lack philosophical preferences (or values, or ultimate desires), it's obviously bad for them to suffer pain (and presumably good for them to enjoy pleasure). So we might need a two-part theory of welfare. The hedonistic component would apply to any beings whatever, telling us that pleasure is good for them and pain is bad. And then a supplementary 'preference' component would apply to beings with philosophical preferences, telling us that people are harmed by thwarting their deepest desires, and benefited by having such desires fulfilled. I find this plausible enough, but now that we've gone beyond a preference account of harm, it isn't clear why depriving an animal of future pleasures (by death) shouldn't count as an additional form of harm.
(2) For this, we need to appeal to claims about personal identity and a self's persistence through time. Many philosophers (from Locke through to Parfit) have been convinced that some kind of psychological continuity is what matters in survival. Here's why: If a mad scientist scanned my brain, disintegrated my body, and then wiped your brain and implanted all of my mental traits (memories, beliefs, values, personality, etc.) in its place, then it seems that I have gotten the better half of the deal. I have survived and you have not. Though your body is the one that lives on, it is our minds that matter, and it seems that your mind has been replaced by mine. In making this judgment, we implicitly judge that it is the content of a mind that matters -- the memories, beliefs, desires, and so forth -- not its "location" in a particular body, or even a particular brain.
Suppose this scenario goes ahead. I awake in your body and return to my old life (as best I can). Does this make any difference to you? Suppose you're told beforehand that after your mind is wiped and replaced with mine, I'll go on to live a happy life. Or maybe you're told that I'll be killed the next day. You might for altruistic reasons prefer the former news, but do you think that you are harmed if the latter outcome occurs instead? If not, this goes to show that preventing future pleasures from being experienced in your body is no harm to you, if you are not the one who will get to experience them.
That's the first premise. The second premise is that only persons have "personal identity", or the kind of psychological continuity (to a sufficient degree) that matters in survival. For a simple-minded animal with no enduring projects or values, it is (morally) as if their mind is 'wiped' at each moment. Many of the aspects of the self that we care about in survival do not endure, as the minds of non-persons are not sufficiently advanced to possess a full 'self' in the first place.* So, if a non-person dies, the being that dies is not the "same one" (in any morally relevant sense) as the one that would have experienced pleasure in the future had it lived. So the one that dies is not harmed, or deprived of any benefit, by death.
* = [They may possess some of the psychological features we care about -- memories, even 'personality' to an extent. It's an interesting question whether this is enough to support a corresponding degree of interest in survival. Perhaps all that we can justifiably conclude here is that non-persons do not share as strong an interest in survival as full-blown persons do?]