During the period in which Voltaire was writing Candide, France was governed by a king who was an absolute monarch. The Roman Catholic Church was the official state church, and under a concept sometimes called the alliance of throne and altar. The papacy supported the divine right of kings and the monarch made the church the official state religions. Because of this entanglement of religion and state, any attack on the church was also seen as an attack on the monarchy. Atheism thus was not just a matter of personal belief as it is in the 21st century western democracies, but also a form of treason against the king.
Voltaire’s Candide attacks both Church doctrines and practices. Thus, if the work had been published under his own name, he could have been jailed or executed for either heresy, treason, or both.