Is "aftertaste" always a bad thing, and are there food products that are supposed to have some (specific) aftertaste?
It likely matter how you qualify 'aftertaste'.
I was watching a documentary on artificial sweeteners, and they specifically mentioned that with sucrose, there's a period of time where you continue to sense it. (I'm having difficulty finding what they called that variable, and what the time is for sucrose ... I want to say it was either 0.5 seconds or 1 second). So they don't want the sweetness to disipate immediately, but they don't want to to hang around too long.
For chilies and hot dishes, people might talk about 'attack' vs. 'sustain'. You can have a spicy dish that's initially powerful, or the ones where you can take a bite and it takes some time for you to get the impact of the heat.
I've used these two together to make deceptive drinks -- you load enough sugar into something that also has significant heat to it, and your mouth considers it to be overly sweet at first ... then after a minute, you start to notice the heat, and you go back for the sweet drink to cool it off, only compounding the problem. (this was a high school/college trick ... I want to say that it involved grape juice concentrate, Tobasco, and Mt. Dew, with the occassional addition of Tang (mixed so it was just a fluid, not dilted to normal strength).
What we discuss as 'aftertaste' are typically unintended longer-lasting flavors that are covered up by other flavors initially, but continue to persist after the other flavors have disipated. This is inherently different from flavor changing foods (typically candies), which typically use two different flavor compounds, one of which is encapsulated so that it releases after the other one.
And there are cases where we may want the lingering flavor, but it's assertive from the start -- mint is frequently used in this way. That might still qualify as an 'aftertaste' though. (although toothpaste isn't a food product)