A word for a person who does something wrong if it's for powerful people

Solution 1:

Check if sycophant(ic) fits.

Though it does not explicitly mean "someone who is generally good", it does mean someone who "might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful". Also, the definition of sycophant does not explicitly exclude "someone who is generally good". You can also check one of the synonyms from ODO (reproduced below).

From dictionary.cambridge.org:

sycophantic adjective; formal disapproving

(of a person or of behaviour) praising people in authority in a way that is not sincere, usually in order to get some advantage from them:

There was sycophantic laughter from the audience at every one of his terrible jokes.

sycophant noun

The prime minister is surrounded by sycophants.

From ODO:

sycophant NOUN

A person who acts obsequiously towards someone important in order to gain advantage.

Example sentences:

An assortment of hatchet men, opportunists and sycophants gained access to the levers of power.

There will be several servile sycophants who will come forward as ‘White Knights’ to regain their lost positions.

Only the most sycophantic of the sycophants would even begin to make such a comparison. [In the past] there was at least a real enemy, there were real things to be done.

Synonyms:

toady, creep, crawler, fawner, flatterer, flunkey, truckler, groveller, doormat, lickspittle, kowtower, obsequious person, minion, hanger-on, leech, puppet, spaniel, Uriah Heep

informal bootlicker, yes-man

vulgar slang arse-licker, arse-kisser, brown-nose

North American vulgar slang suckhole

Solution 2:

As a single-word-request, there might not be a perfect word that specifies "giving in to an authority".

More general words include

If the connotation is that the person doesn't want to do it but is doing it out of fear of reprecussions:

  • Impressionable
  • Meek
  • Weak-willed

If the connotation is that the person is doing it because they have an agreement with the authority figure:

  • Corrupt
  • A lackey or servant

In your example, though you specify that the person has no weight on her conscience by her action of doing as the authority figure wants, which points to someone who isn't meek, but is more cold-hearted or unfeeling. In such context you might want to be more descriptive than a single word and specify why the person has no weight on her conscience.

"She left the house [...] and, out of pure selfishness, had no weight on her conscience because the repercussions of acting against the mother would have far outweighed any feeling of good-doing that helping Madeleine could have given her."

Solution 3:

The behaviour of indulging the wrongdoing of authority is actually so common, that it is a person displaying the opposite behaviour who is called by a specific term: whistleblower.

Historically the failure to report a criminal offence was itself a criminal offence called misprision, but the term is now as archaic as the obligation.

A catch-all term nowadays would probably be a collaborator, which is capable of not only including those who actively assist or cover-up, but those who wilfully turn a blind eye, including through approval, blameworthy weakness of character, or a wrong ordering of moral priorities.