Tom admires the uniforms of the Cadets of Temperance and joins them so that he can strut at the funeral of Judge Frazer, who is dying. When the Judge has a turn for the better, Tom resigns from the Cadets of Temperance, but then the Judge has a relapse and dies. The funeral is a fine thing, but Tom is free from it. He attempts a diary, but nothing comes of it. He attends a minstrel show, and he and Joe play minstrel for two days. A senator comes, but he is not impressive. A circus comes and leaves the next day, so the boys play circus for a while and then abandon it. A phrenologist and a mesmerizer come, and still the boys are bored and dreary.
Then Tom has the measles for two weeks. He is better for a short time and then has a relapse that lasts three weeks. Between the two bouts with measles, all his friends get religion--even "Huck quoted some scripture!"--but by the end of the second bout, all is normal again.
As with Chapter 21, the purpose of Chapter 22 is not so much to move the story along, but to show the boredom that pervades during vacation in a small town. Twain presents this boredom by showing the boys trying one type of amusement and then quickly changing to another type. The significance of both these chapters is that Tom's life--any child's life, in fact--can be common and boring. During the summer months, so anxiously awaited, the boys feel an isolation and loneliness that they do not necessarily feel during the rest of the year. In other words, tedium is worse than school.
Making matters worse for Tom, Becky is away on vacation; thus he struggles to find things to do. For this reason--and because he is attracted to their fancy uniforms--Tom joins the Cadets of Temperance. He soon drops it, however, and picks up something else to occupy him for a time. The irony is that Tom wants to wear the showy uniform; however, the cadets are only wearing the uniforms because the judge is dying. When the judge doesn't die, there is no need for wearing the uniform and thus, Tom quits.
In many of his writings, Twain pokes fun at organized religion, and he takes the opportunity to do so again here. With Tom and his friends, Twain points out the superficiality of religious revivals. In the nineteenth century, religious revivals were a common occurrence in the summer. Here, all the boys "got religion"--momentarily, at least.
After the interludes of these two chapters, Twain returns to his main plot line.