The story is set in the mid-1800s, when the life expectancy for most Americans was under 50. Americans during that time did everything at younger ages, including getting married and having children, or marching off to war. Rural kids, like Tom Sawyer, who were raised by the land as much as they were by parents or the community, were very independent minded and possibly rebellious, as Tom shows by befriending a runaway slave.
There was a greater percentage of people in those days who did smoke, too. There was no such thing as a filtered or "light" cigarette, all cigarettes were made by hand, though many people smoked pipes instead at that time because they were easier and reusable.
To the heart of the question about whether the story encourages kids to smoke, I would have to say an unequivocal no. Kids are smart enough to know the story is set in the past, and that the character's actions are not endorsements of them. They realize the story takes place in a different time, and different setting than their own lives, and they can make the distinction in judgement. Tom Sawyer encourages smoking about as much as reading the Old Testament encourages slavery, in my opinion.