The purpose of all fiction might be taken as entertainment or self-expression. Does Jackson have any other purpose in "The Lottery"?
Entertainment and self-expression are limited reasons for writing fiction. One of the larger, more important reasons for writing fiction is to express human emotions that are often inexpressible. I think this is Jackson's purpose when writing "The Lottery." She wants the reader to think about the human condition and how easily individuals can be led to do evil that they wouldn't ordinarily commit.
"The Lottery" recounts an annual ritual. Every year, people in this rural village gather to undertake a grotesque lottery, which results in the death of one of their members. Everyone in the community, even the family members of the condemned, participate in the killing. They do this because it is the norm.
Jackson uses the Old Man Warner character to let the audience know that the lottery has been around for a long time and they think it is especially important to follow the tradition. Old Man Warner, whose name itself suggests the old ways and tradition, says, "Used to be a saying about 'Lottery in June, corn be heavy soon.' First thing you know, we'd all be eating stewed chickweed and acorns. There's always been a lottery."
But through narration, Jackson makes it clear that the younger people in the village do not understand the tradition behind the lottery:
"Although the villagers had forgotten the ritual and lost the original black box, they still remembered to use stones."
So what is Jackson doing with this fiction? While this story is definitely entertaining and I'm sure represents some self-expression, I'm sure that these aren't her primary purposes for writing this. In fact, her purpose for writing this might be exemplified in hundreds of letters The New Yorker received for publishing the story. Perhaps these people saw something of themselves in the characters? Perhaps, with the ending of World War II just three years earlier, and the stories of the attempted genocide of Jews in Eastern Europe and the fact that ordinary people participated in this atrocity (later called the "banality of evil"), people realized how easily they could be drawn into something they would ordinarily consider evil (murder by stoning in this case).