The way I try to explain it to people is that in game terms, Good and Evil aren't what we mean by good and evil in the real world, where they tend to be nebulous concepts dependent on one's views of morality, or on the moral code of the society or religion you believe in. That's a sort of philosophical view of good and evil that one can argue about.
In D&D and the Realms, and especially in terms of the Alignment System, Good and Evil simply mean what the gods and the divine and magical systems that underpin the universe SAY is Good or Evil. It is a purely categorical label. If an act or thing is listed under the Evil category, then it's Evil.
Now your character might disagree with that philosophically, and from a philosophic or moral point of view they may even be right. But from the perspective of the gods and the cosmology, that doesn't mean jack. And that's what spells, detection, magical items, etc all go by.