Sometimes people do things 'we' believe to be wrong, this is simply because it is 'NOT' wrong to them as they justify it to themselves. If someone does something however (as per your thread question) that they themselves believe to be wrong, it is because some sort of pressure is coming to bear on them...maybe peer pressure, financial pressures, emotional pressures etc. ie Peers pressuring you to take drugs to fit in, you feel its wrong but you want to fit in, so you do it anyway. You know stealing is wrong but the bills are piling up, you have no money to buy food for your kids, so you shop lift. You know killing is wrong, but your husband has been beating the crap out of you daily for years, you mentally and physically can take no more...you snap and you kill him. All these things you believe to be wrong but you may find a reason for justifying them in order to satisfy your needs at the time. Of course we don't ALL behave like this!
Alot of times addiction/emotional addiction plays a big factor. Like if a smoker is really worried about their health, and really wants to stop smoking. (Not saying smoking is wrong or right.) The smoker might continue to do it anyway even though in their mind, they might want to stop, but in their body, they crave the cigarette. As for things such as lying or ripping people off. A person might believe doing X is wrong. A person might do X anyway, knowing and understanding X is wrong simply because the person does not know what else to do in order to get an outcome. This generic scenario can be used with any example when people do things they believe is wrong. For example, a person might break into somebody's house for the outcome of getting money. If the person doesn't believe what he is doing is wrong, and the person believes what he is doing is justifiable, the person does not apply to this thread. If he believes what he is doing is wrong, and is doing it anyway, it is because he doesn't know what else to do to get the money outcome. But how could a person be that stupid to not know what else to do to get the money outcome? Sometimes it is in the heat of the moment, when he does not have time to think, and he does whatever comes to mind the fastest. It is often a question of desperation. Sometimes a child is getting out of hand, but the parent might be busy with something else. The parent might know how to keep the child at bay without force, but the parent might not know how to keep the child at bay immediately without force. Therefore, although the parent might knows there are ways to keep a child at bay immediately without force, the parent might not know how to do it. Therefore, because the parent wants the outcome of immediately keeping the child at bay, though the parent might know slapping the child is wrong, the parent pushes or slaps the child anyway because the parent in that moment could not think of a proper resolution.
Because people are a function to rules and doctrine, which is independednt of right and wrong, but a mere reflection of perspective; an appendage of miscommunication
Lack of will; lack of opportunity; lack of empathy; lack of self respect; lack of logic... basically, they do it because they lack a certain faculty or moral.