In my opinion, Dill tells these lies to get attention and to compensate for what he feels is a home life that does not give him what he needs. We know that his parents really do not pay much attention to him. He enjoys his summer trips to Maycomb much more than he likes living back at home.
So I think that Dill sort of feels like no one pays attention to him. By telling these kinds of tall tales, he can feel special and make people pay attention to him. If he has seen an elephant, or been up in an airplane seventeen times, that makes him special and that is a feeling he doesn't get enough of in real life.
In the book "To Kill a Mockingbird," Dill's character is based on the real life character of Truman Capote. Dill has been shoved around from one parent to another. His mother worked in different industries that exposed Dill to many things. Dill was also an avid movie theater attendee. He expresses that he likes movies and probably had a pretty good imagination after seeing them. Scout and Jem don't even have a theater nearby.
Dill is not happy in his life. At one point he runs away and hides under the children's bed. Scout wants to cover for him but Jem tells Atticus. Dill compensates for his unhappy life by telling tall tales and stories.
He probably does this to feel better about himself and his life. His life is a mess and his true family is terrible to him. He is quite lonely as well. His step dad locks him in the basement so he cannot go anywhere, but luckily he escapes and goes to Scout and Jem. He prefers this family more because they truly care about him.
Dill tells alot of lies. we see scout telling us that he lies when the author says: "Dill Harris could tell the biggest ones i ever heared." Some of his lies is that he has "been up in a mail plane seventeen tines, he had been to Nova Scotia, he had seen an elephant, and his granddaddy was Brigadier General Joe Wheeler and left him his sword."
I think Dill tells alot of lies to cover up his life. He is a sad individual. He trys to make his life seem iteresting so he does not have to face the bad things in his life or let his freinds now the bad truth.