I generally try to avoid lying. Some sugar coating or fudging to avoid hurting someone's feelings or to protect myself from unfair judgement is ok. I just don't tell people things i would rather they don't know atm. I tell them when it either becomes a necessity or I feel it no longer matters that they know because they won't judge me because of it.
IMHO, lying is for different reasons:
Prestige
People lie for prestige and reputation; either concealing elements of themselves that they deem to be dishonourable or contemptible, or exaggerating/inventing traits that are positive.
Manipulation
For tactical purposes; perhaps to undermine the credibility of a rival, punishment of a wayward ward, or simply out of malice.
Self-preservation
Presented with the possibility of sanction for decisions either made or not made, people will resort to lying in order to ensure that blame is either deflected or neutralised outright.
As much as we all would love to have a perfect person no such man or woman exists, but we all have the capacity for good bad and a bit of the gray in between the two. What you have to answer for yourself is which lies to you are harmful/harmless, because sometimes you just have to look at the bigger picture. Not to say flush your ideals or morals.
People lie because people believe them, duh.
I have person in extended family who doesn't finish one sentence without a lie. It's hard to listen to that, really. She does it to feel better about herself and I believe that now in her 39y she is not aware of doing it anymore. I don't know what happened in her teens but she was like that her whole life. It's a bitch when you cannot accept who you are and go from there.