Police said a monk was among those hospitalised after the cloud of insects descended on a temple at Mundal, 110 kilometres north of the capital Colombo.
The attack came as pilgrims celebrated the festival of Vesak honouring the birth, enlightenment and death of the Buddha.
Earlier this week two wasp nests were removed from a Sri Lankan tea plantation as part of preparations for a visit by Indian Prime Minister Narendra Modi.
There was a risk helicopters landing nearby could stir up the nests and provoke an angry response.