The correct option is
D To do something wrong
The given phrase means 'To act in an unfair or bad manner'.Option D is correct. 'unfair or bad manner' can be interpreted as 'something bad'. Thus, option D is closest in meaning to the required meaning.
Options A, C and D are incorrect. They do not have the required meaning.