Is there a word for someone who feels guilty about something they are doing but knows that he or she can't help it so they try to make logic of it and comfort themselves with the reasoning?
How about rationalizer, a person who rationalizes or engages in rationalization?
rationalize: to think about or describe something (such as bad behavior) in a way that explains it and makes it seem proper, more attractive, etc.
I can't think of a noun but often the person is said to be justifying. I've also heard the clumsy word compartmentalizing. It was used often when speaking about President Clinton and how he could compartmentalize actions he was ashamed of in one respect and then would perhaps subconsciously close that proverbial compartment and then open up another one that was more socially acceptable as a way to rationalize in his own mind that they almost were done by two separate people or parts of his personality. Many people do this to deal with darker sides of their personality in order to function in society in day-to-day life as a coping mechanism.