pemerton said:
Those definitions, and some of their later-edition counterparts, use concepts like "dignity", "rights", "innocent", "truth", "beauty" etc.
So what does a Detect Good spell latch onto? Does it latch onto a character's attitude towards, and treatment of, truth, beauty and human dignity? But in that case, who gets to determine that the Seven Heavens rather than the succubus has really got the hang of beauty and dignity?
I might quibble with the degree to which these concepts are part of alignment (or which particular concepts are exclusively part of one alignment or another), but there is a rather explicit answer to this question in
Planescape.
In PS, if something is "Good" ("right", "helpful", or "conscientious" to use 5e's concepts) it is because most creatures believe it to be so. A demon who detected itself as evil would know that, as defined by the belief of most, it was not right by society, helpful to others in need, or acting according to a conscience. The same would be generally true, of, say, a modron (who acts in accordance with a code that may not always line up with what is right by society), or a slaad (who follows whims which may be entirely conscience-free).
"Most creatures" becomes in the setting a more narrative concept than a numerical concept - "most" in this case means a number so unreasonably large that it might as well be (and may actually be, depending on the DM's interpretation) infinite. PS protagonists often change the setting by changing how "most" creatures believe, by accomplishing tremendous actions and affecting the hearts and minds of people far removed from their current surroundings (a kind of butterfly effect). Part of the reason you play PS is because you want to play such a character, so the setting makes such a character possible.
So "detect good" in PS latches onto if most people believe the target to have the qualities that most people have defined to be good, or if they do not believe that (in 3e, this would be explicitly "altruism, respect for life, and a concern for the dignity of sentient beings").
In PS, that friendly business associate would probably still ping as evil (most people believe that they hurt, oppress, and kill others, to use 3e's terms).
pemerton said:
But this passage gives rise to another point: the claim that no one has an inherent reason to do good (let's say, to promote the interests of others even when this doesn't directly further his/her own interests; to encourage beauty rather than squalor; etc) is iteslf hugely, hugely contentious
It is not so much contentious in D&D, where "Good", at least in 5e, only means that you do right by society, you help others according to their needs, or you obey your conscience (presumably, excluding people/creatures who cannot form a conscience), and that when you die, your soul goes to A Particular Place. There's plenty of reasons one could have to reject what society thinks of as right, to refuse to help others, or to ignore your conscience. This would make you not-good. These are also things that every human being is familiar with doing in their lives.