There is a tendency not only by the lay public, but also by professionals, to confuse habits with compulsions. They are definitely not the same!
A compulsion is an activity that is repeated over and over to cope with intrusive thoughts and fears. For example, a person washes his hands repeatedly, consuming many bars of soap even though he knows that his behavior is out of the ordinary. No matter how hard he tries, a persistent fear of germs threatens to overwhelm him. So he wards off this intense anxiety by repeatedly cleaning his hands. He can tell himself that this is irrational. He "knows better" but cannot seem to overcome his fear and the consequent behavior to deal with that fear.
Then there is what many experts term pathological or compulsive lying. The person, perhaps understandably, lies to cover his tracks, to dig himself out of a jam, or to avoid embarrassment. What baffles others is that he lies when there seems to be no identifiable purpose. He'll claim he ate at McDonald's when he went to Burger King. He'll say he bought something at Walmart when he actually was at K-Mart. People in his environment are puzzled and frustrated as to why his lies seem to roll off his tongue as automatically as he breathes. They wonder if he may not be able to discern truth from lie. Perhaps, he cannot help himself. Such behavior has been termed compulsive lying. But there is nothing compulsive about it.
If one understands the world from the standpoint of the liar, then the purposeless lie has a purpose. By lying, the individual builds up his opinion of himself as special, as unique, as having power over others because he can pull the wool over their eyes and make fools of them. Lying becomes a way of life for several reasons. One is that the liar has a great deal to conceal so he does not get into trouble. Then, once caught, he lies to find a way out. Third, even in seemingly trivial matters, he is determined to gain the upper hand. He can look you in the eye and lead you to believe you are hearing the truth. Actually, because there are far more lies of omission than commission, you are hearing only a part of the truth. Because the liar is so skilled, you think you are getting the whole truth. If he tells the truth about something seemingly important, that gives him more room to get away with lies about other matters.
For the criminal, lying is a skill, not a compulsion. He has been lying since he was a child. He has no shame about doing it. There is no compulsion at all to lie. He will tell the truth if he thinks it serves his purpose. Because a particular behavior becomes a habit, it is not a compulsion. We brush our teeth a certain way. But, we are under no "compulsion" to brush our teeth as we do. If the dentist lectures us, we can change our habits if we are motivated to do so. Long standing habits do not die easily. It takes work to overcome them.
The criminal has more than enough excuses for his behavior. We should not provide more by conceptualizing long standing patterns as a compulsion or some other sort of mental disorder.