I am looking for a word that means going along with something you know is wrong in order to get ahead or stay in the good graces of a superior. This could mean knowingly supporting a false interpretation of a situation such that it injures someone else, but not caring because you come out ahead. The word is not "venal," because venal implies bribery.
A mercenary is someone who does something for money without regard to the morality of the action...or to quote Google dictionary's definition of mercenary:
"(of a person or their behavior) primarily concerned with making money at the expense of ethics."
"Biting one's tongue" is slightly more neutral than your example (i.e. it doesn't imply doing it for any particular reason)
To "toe the line" generally does imply that you're doing it unwillingly, because 'fitting in' is important to you, but not because of need for personal advancement, sometimes out of fear.
Or you could go for something less complimentary, like 'ass kisser' 'brown noser' 'sucking up' etc.
Thank you for these suggestions. As I searched online for the exact word for the situation I wanted to describe, I came across the word "hack," meaning, "a professional who renounces or surrenders individual independence, integrity, belief, etc., in return for money or other reward in the performance of a task normally thought of as involving a strong personal commitment" (definition found on Dictionary.com). This is pretty close to what I was after.
You could try
Defined by The Oxford Pocket Dictionary of Current English as:
a person who exploits circumstances to gain immediate advantage rather than being guided by consistent principles or plans.
most burglaries are committed by casual opportunists
A yes man.
:a weak person who always agrees with their political leader or their superior at work. [OED]
Their eyes glazed over and their lips turned into a smug smile, Donald Trump's Cabinet continued to be the yes men that he wanted, every last white male among them.
Although my example could also mean they don't know what their doing in the first place.
There are a number of words or phrases that come to mind. An old-fashioned one is a "trimmer." "Sycophant" and "opportunist" at least come close to what you are trying to express, but "opportunist" has a broader field of meaning whereas "sycophant" has a narrower field. "Yes-man" seems exact, but it is informal and may be an Americanism. There are scatological phrases that may apply.