Kraydak said:
I will note that defeating Det Evil, in a ceremonial type setting (your yearly morals check at the church, say), is quite difficult. A simple requirement that you be "clean" (i.e. don't ping on det magic) is very hard to bypass.
Nystul's Magical Aura cast on your Amulet of Undetectable Alignment will do it. I would have thought it should be possible to research a similar spell of about 2nd or, at most, 3rd level, that works on a person rather than an object.
As an aside, DnD characters, be they PCs or NPCs, WILL get scanned, continuously. Especially government officials and nobility (and their servants, oh my and their servants).
1) While our benevolent society is busy purging all the Evil members of its populace, all those neighbouring states are busy invading, and wiping them out. Worse, since the nation has just purged all its most effective rat-bastard generals/intelligence operatives/assassins, they're in a lot more trouble than they otherwise would have been.
2) Just how many Paladins does this nation have to go around doing this continuous scanning? And don't they have better things to do with their time?
3) In a feudal society, I doubt the nobles would stand for that sort of thing. As discussed up-thread, they hav no way of seeing the results of the test, and so might well fear that their rivals will have bribed the local 'Paladin' to flag and remove them. And, in a feudal society, the king actually can't force this sort of thing on an unwilling nobility - they'll simply band together and replace him with one of their own number.
Of course, under other forms of government, things work rather differently. However, it generally remains the case that the power of the ruler is not so overwhelming that he can force it on a populace that is unlikely to accept it.