Well that's quite the juicy question, and a subject of debate since long before this forum! We have several threads on this very topic, but here's an overly brief synopsis:
The academics have basically divided into two camps on this subject, while I and I think some others have a hybrid view. One view is the realist view, which is that the gods exist (or at least Epicurus believed they exist) as he has described them. The other view is the idealist view, which is that the gods are an ideal culmination of Epicurean philosophy, and an ideal to strive for even though they don't exist.
Some things to examine:
- Epicurus has described the gods as material, in a way that follows the overall logic of his materialism. This can be compared to his description of sight, of memory and of other phenomena in terms of atoms and void and nothing supernatural.
- My knowledge of the culture of Athens of his day is sketchy, but I also think that he saw some value in festivals and worship, as long as one kept in mind that there is nothing supernatural. There are various pleasures to be had in celebration and in being part of a community, and I think that he wanted to make use of these.
- Then there's the fact that science has advanced in the last 2300 years. Epicurus was a philosopher, not a scientist. Much of his thinking was remarkably prescient, but we also have far more information than he had access to. So, on the one hand we need to consider his ideas in light of modern science. But on the other hand we need to do our best to follow his reasoning and motivations, which is extremely difficult given the limited quantity of his extant texts.