An author's purpose in writing a story is generally expressed in the theme. In this case, Shirley Jackson wrote "The Lottery" in order to express the theme of mindless adherence to tradition. Let's face it. The only reason this town continues to conduct a lottery is because they've always done it. Other towns have done away with the practice--much to the dismay of the old-timers in town such as Old Man Warner--so we know it can be done. At one time, perhaps, the lottery was somehow connected to a fertility ritual, sacrificing to the gods in hopes of finding favor for the crops or the town or whatever. Now, though, the practice is senseless and even barbaric. Why do they continue to do it, then? Because they always have. Oh, it's changed some over the years--they use paper instead of wood chips, and many of the rituals connected to the event have been lost; at its core, though, though, this is the mindless, unthinking, unquestioning repetition of what has always been done. The question Jackson clearly asks is whether we have any mindless traditions which we adhere to without rhyme or reason, and is that a good thing.
When I teach "The Lottery," I'm always reminded of the story about a mom who was preparing a roast for dinner. She would always cut the ends off the roast, and today her daughter asked her why she did that. The mother said she did it because that's the way her grandmother always prepared her roasts. Later, the young girl asked the grandmother why she cut the ends off the roast before putting it in the oven, and her answer was simple: "Because it wouldn't fit in the pan." All these years of cutting the ends off the roasts for no good reason. What a waste. And that's the point.
There's more, as this is a complex story, but this is the primary theme the way I see it. I've also attached an excellent e-notes summary of themes site below for some further insights on this story.