Different kids do it for different reasons. I can't tell you why yours does it from your letter. With mine it was usually avoidance of trouble/consequences, and I think they are mostly over it now. Oh--but one of them will sometimes lie in the sense that he comes up with general science "facts" and says them really confidently so he'll sound smart, but he just makes it up, or maybe he remembers things less accurately than he realizes...
I never lie to my kids ever, except as an obvious silly joke answer to a question---SO, I have tried explaining this and telling them why: because I respect them, and lying is something people do when they are trying to *trick* someone. It's what people do when they think the person can be fooled because they are not smart--so it is insulting someone to lie to them...plus it makes people not trust you any more, and makes them feel bad and not want to be around you. I'm not sure if the speech helped or not...but that's what I told them.
Another idea--If your son just tells whoppers randomly, instead of a lecture you could teach him a lesson. You could try this---as a family (maybe even bring a neighbor in on it)--all of you pick a day and you all tell crazy lies randomly when you are talking to him (about dinner, activities, homework, whatever), so that he can tell something is going on, and he won't know what is true and what isn't, and won't be able to get any straight answers from his family, or have a normal conversation with any of you. Of course, he might find it funny... or he might learn how frustrating it feels to be on the other side of the lies! If he doesn't like it, and asks why you are doing it, you could tell him that since he seems to have so much fun lying, you just all thought you wanted to lie, too. Then ask if he thinks it makes life easier or harder.