In some ways, this is obvious: If you want to be seen as an upright person, you shouldn’t hang out with criminals.
But it’s about more than simply avoiding crooks. Are you planning to run for public office? Then perhaps you should quit the men’s-only private club. Do you tout your record as a responsible steward of the environment? Then why are you sitting on the board of a corporation that routinely pays fines for illegal dumping? Friend of animals? Don’t wear fur!
Avoid entanglements and deeds that cast doubt on your message.