Montresor specifically chooses the carnival as a setting for his murderous plans to help conceal his crime. In this way, setting is crucial to the plot.
As Montresor spots Fortunato in the streets of the festival, he notices that the man is already feeling the effects of an alcoholic celebration:
He accosted me with excessive warmth, for he had been drinking much.
This demonstrates Montresor's knowledge of the way Fortunato would participate in the festivities. Fortunato's propensity for alcohol also means that his judgement is already impaired, and he will be less likely to ask questions that could ruin Montresor's plans.
The festival also provides a means for festive dress. Symbolically, Fortunato is also wearing a "conical cap and bells," or a clown's hat. This represents Fortunato's foolish trust in Montresor's devious plans.
Montresor knows that Fortunato has a "weak point" in his pride of wine connoisseurship. Because of the festival, mentioning his own supposed doubts about a cask of Amontillado is a particularly easy means of diverting Fortunato into the man's eventual place of death.
The festival also provides Montresor with a means of getting rid of everyone who might witness him entering the family's catacombs, thereby ensuring there are no witnesses to his crime:
There were no attendants at home; they had absconded to make merry in honor of the time. I had told them that I should not return until the morning, and had given them explicit orders not to stir from the house.
In short, Montresor is able to utilize the festivities of the carnival in combination with his knowledge of Fortunato's weaknesses and exploit both for his murderous plans. He correctly predicts that Fortunato will be so wrapped up in the festivities that his judgement will be impaired, and Montresor is thus able to lead him to an eerie catacomb because of Fortunato's pride.