I think in real cases, a different religion or idiology will permit, in the perpetuator's view, the needed actions as being worth the result or sactioned. Or, "morals" may apply only to the "in" group anyway.
Or, the moral values may exist but be quite different. For example, I see nothing wrong whatsoever with eating a bacon-cheese-burger, trimming my beard to look nice, and wearing clothes made from blended fabrics. Someone who held these as examples of sacred principles that must be adhered to under penalty of death (see first point: not killing is also a moral principle nominally held by the same group) would accuse me and mine as being "without morals", but is misusing the term.
Strict adherance to possibly arbitrary rules is not "morals", and constrasts with morality if the rules under consideration don't have anything to do with the charter of morality, i.e. actions that affect the well-being of others.
Your mention of atheists as synonymous with sociopaths makes me think that you are making that same mistake: strict adherance to rules including those that have nothing to do with morals, is not "morality". To note that a true sociopath would not be religious either is redundant.
It is possible, though atypical, to find a group that is religious and highly moral in general rather than just following rules that apply only to the "in" group and would appear immoral toward others. A successful religion is rarely missing the "kill the infidel" meme as it contributes greatly to the fitness function and those that lack it can't compete.
I have heard of some examples though: the Jains, where Gahndi learned pacifism, and Operation Whitecoat. Individual small groups might be truely (globally) moral and object to violence etc. even though the main religious organization is not so pure.
The test: the truely moral group practices self-sacrifice and will help strangers and the population at large. If a confidence artist infultrated the 7th Day Adventists during WWII, for example, his purpose will be truely selfish. If the group is going in to test biological and chemical weapons (instead of enlisting in the service which carries guns), as in the Whitecoat link above, I think you will find the infultrator cannot fake his self-sacrifice.
In short, willingness to show moral values on the part of the religious group, not the willingness of the infultrator to be amoral, will be how he is spotted.