Pierre Bayle, a French thinker who died in Rotterdam in 1706, is the ­forgotten hero of the Enlightenment. His name sometimes rings a bell for historians of philosophy, but apart from them I cannot remember when I last met anyone who had heard of him. In the 18th century, however, Bayle’s admirers included Frederick the Great, Thomas Jefferson, Benjamin Franklin and Voltaire. They revered him for his defence of religious liberty and his genius for undermining conventional ideas. Voltaire said that the “immortal” Bayle was the greatest reasoner who ever set pen to paper.

Immortality, it seems, does not always last. One reason for Bayle’s eclipse is that his ideas no longer seem novel or shocking; moreover, his writings digress uncontrollably. This is not a winning combination. His Historical and Critical Dictionary – once among the commonest books in northern European homes – is a jumble of more than six million words, most of which come in rambling footnotes. Published between 1697 and 1702, it was a unique source of ­information and argument at that time. Now we have Wikipedia. Bayle’s pioneering tract on religious freedom is titled A Philosophical Commentary on These Words of the Gospel, Luke 14:23, “Compel Them to Come In, That My House May Be Full”. If you think the title is unwieldy, you should see the book.

Bayle’s passion for religious liberty reflected his circumstances. Unlike better-known champions of tolerance such as Voltaire or John Locke, he had first-hand experience of persecution. He was the son of a poor Calvinist pastor in a small French town near the Spanish border. Protestants such as the Bayles were a harassed minority in France, where roughly 95 per cent of the population was Catholic.

Thousands of Bayle’s co-religionists had been massacred in the late 16th century, and even though Protestants won some freedoms at the end of the French wars of religion in 1598, their position worsened during Bayle’s lifetime. He fled to the Netherlands in 1681, when he was in his early thirties. A few years later, one of his brothers was arrested and died in a French prison. If he had converted to Catholicism, he would have been released. Bayle never got over his brother’s death.

Bayle had the misfortune to be not only a heretic in Catholic eyes, but also an apostate, for which the punishments were still worse. In his youth, he had briefly been convinced by the intellectual case for Catholicism and had converted. After about a year and a half as a Catholic, however, he decided that he had been mistaken and switched back. He followed his conscience, and this became the linchpin of his case against persecution. Why would God have given us a conscience if He did not mean us to use it?

Even if an alleged heretic, such as Bayle, was in error and was worshipping the wrong God, or worshipping Him in the wrong way, might this not be an honest mistake? He used a well-known example of mistaken identity to make his point. The wife of the peasant Martin Guerre sincerely believed an impostor to be her long-lost husband. When the real Martin Guerre returned to his village, the impostor confessed and was executed for adultery and fraud. But Guerre’s wife went unpunished, because her error had been made in good faith. Bayle reasoned that “heretics” should be treated in the same way. If they had searched diligently for the truth and acted conscientiously, they were guilty of no sin. Nobody should punish them or try to compel them to act against their honest beliefs.

At the time, this sort of tolerance was regarded as tantamount to heresy by all too many theologians. According to influential writings by St Augustine, Jesus had sanctioned religious compulsion in the remark from the Gospel of Luke quoted in the title of Bayle’s book on the topic. Bayle demonstrated at length that St Augustine had read too much into the biblical passage and had misinterpreted Jesus’s words. Besides, Bayle forcefully pointed out that every so-called heretic thinks that he is a true believer and that it is others who are the heretics. So, if persecution is permitted, every religious group will feel entitled to harass all other groups, and the result will be constant bloodshed. This does not seem very Christian.

The upshot of Bayle’s argument was that every Christian sect, and all other faiths, too, should be left alone to believe whatever they want, provided they do not interfere with others. Locke, who was writing on the subject at around the same time as Bayle, maintained something similar but did not go quite so far. Locke was uncomfortable with Eastern religions in which divine revelation did not play a significant part. And he worried that Catholics were politically dangerous, because they owed primary ­allegiance to the pope rather than to their national sovereign. For Locke, Muslims were also likely troublemakers, if they were loyal to the Ottoman emperor. Yet Bayle does not seem to have been particularly bothered by the potential subversiveness of Catholics and Muslims, or by the unfamiliar faiths of Asians. Religion was personal and that was that.

Nor was Bayle much troubled by the notion of atheism, either, which is perhaps the most modern thing about him. Locke maintained that unbelief cannot be tolerated, because it is bound to lead to the moral collapse of any society foolish enough to allow it. Voltaire thought the same. Bayle seems to have been the first person in the Christian world to deny this conventional opinion. Morality, he reasoned, can exist perfectly well without religion.

Rather typically, he made this shocking claim in the course of a meandering digression. It came in his first book, which was ostensibly about comets and contained, as Bayle acknowledged, “a strange heap of thoughts”.

When an exceptionally bright comet was spotted by a German astronomer in late 1680, it caused a panic. Comets had presaged countless disasters, from the fall of Carthage to the Norman invasion of Britain, or so it was widely believed. Hundreds of alarmist pamphlets were published across Europe and in North America, announcing that the new comet was a dire warning from God to repent immediately.

Bayle set out to show that it would be against God’s nature to use celestial phenomena to send messages to mankind. With typical thoroughness, he offered eight main arguments for this conclusion, supported them with several hundred texts, ancient, medieval and modern, and made sideswipes at dozens of other superstitions along the way.

The argument of which he was most proud was original, effective and simple. It was that any such divine warnings would be bound to backfire and achieve the opposite of what God supposedly intended.

It was easy to show from scripture that God abhorred the worship of false gods. ­According to the prophets, idolatry seemed to rile Him even more than murder, theft or adultery. Yet most people on the planet are not Christians. As Bayle put it, the majority of human beings “remain idolators or have become Mohammedans”. So, if God put awe-inspiring warnings in the sky, most people would just embrace their false religions even more fervently. Why would He send harbingers of doom that could only “reanimate false and sacrilegious devotion almost everywhere on Earth” and “increase the number of pilgrims to Mecca”?

Perhaps, Bayle mused, someone will say that atheism is even worse than idolatry, so God might arrange fiery displays in order to ensure that people embraced some religion rather than none. It was here that he made his revolutionary suggestion about religion and morality. People generally thought that atheism was disastrous for society because unbelievers had no incentive to be good. Yet Bayle pointed out that people’s behaviour reflects their character, desires and circumstances, rather than the religious principles to which they pay lip-service at weekends. As one moralist put it in the 18th century: “It ought not to appear more strange to us that an atheist should be a quiet moral man, than that a Christian should lead a very wicked life.”

There was, Bayle argued, no compelling reason to think that an atheist society would be full of vice. Why assume that the godless would have less fellow feeling or less desire for respect and approval than anybody else? At the time, there were no known societies of atheists, so his idea could not be put to the test. We now know that he was right. There are plenty of civilised places – Denmark and Sweden are striking cases – in which atheism is very common.

Many of Bayle’s contemporaries were convinced that he was, in fact, an atheist and that his professed Calvinism was a sham. Others maintained that he must be a Jew, on the slender grounds that he evidently knew a great deal about Judaism. Bayle’s inner convictions are certainly something of a puzzle. When a clergyman questioned him about his religious views, he supposedly replied that he was a good Protestant, “in the full sense of the term”, because “I protest against everything that is said, and everything that is done”.

One idea against which he protested vehemently is the notion that human reason is powerful enough to explain and defend religious truths. In several places in his Historical and Critical Dictionary, Bayle sang the praises of ancient Pyrrhonism, a form of Greek scepticism that advocates the suspension of judgement in all theoretical matters. These parts of the book had a great influence on several 18th-century philosophers, especially David Hume and Bishop Berkeley, who put Bayle’s Pyrrhonist arguments to their own uses. The German ­historian Ernst Cassirer aptly described the dictionary as “the real arsenal of all Enlightenment philosophy”.

The virtue of Pyrrhonism as applied to religion, according to Bayle, is that it makes people “conscious of the darkness they are in, so that they will implore help from on high and submit to the authority of the faith”. His attacks on various parts of theology were, he claimed, merely intended to shore up Christianity by removing its shaky foundation of bad argument.

An example of this is his treatment of the so-called problem of evil. Why is there so much wickedness and suffering in the world? Bayle went through the standard theological answers to this question and knocked down each one, often with a vivid analogy. Is God absolved of man’s evil by His gift of free will – which makes everything man’s fault? No, Bayle answered: that would be like giving a knife to a man when you know he will use it to commit murder. The gift does not absolve the giver. Did God permit man to rebel so that He could send Jesus as a redeemer? That, Bayle replied, would make God “like a father who allows his children to break their legs so that he can show everyone his great skill in mending their broken bones”.

The real answer, he insisted, is that we cannot comprehend why God allows evil. A true Christian must simply accept that He does. The German philosopher Gottfried Wilhelm Leibniz, who was Bayle’s contemporary, was so upset by these arguments that he devoted the Theodicy, his only full-length philosophical book, to refuting them. Leibniz was sure that he could offer satisfactory excuses on God’s behalf and explain exactly why He permitted evil to exist.

The world, Leibniz tried to show, would have been even worse in various respects if there had been no evil in it, and our ­apparently miserable existence is the best that God could possibly have provided for us. So, we should be grateful. The term “optimism” was coined by a reviewer of Leibniz’s book to describe this bizarre but sunny doctrine. Voltaire had great fun ridiculing it in his novella Candide.

***

It is easy to see why many of Bayle’s readers thought that he was only pretending to believe in God. Could such a merciless critic of religious reasoning really have been pious in private, or was he feigning faith? It is impossible to tell. Besides, there is a third possibility. Perhaps sometimes he believed, and sometimes he didn’t. One reason why he was such a peerless dialectician is that he was good at seeing both sides of an argument.

Intellectual modesty was the virtue that Bayle preached most often, which is why he was held up as a hero by the 18th-century philosophes – that is, by Voltaire, Diderot and other leading contributors to Diderot’s Encyclopédie, the final, supplementary volumes of which appeared on the eve of the French Revolution. Nowadays, “Enlightenment” has become a rather nebulous notion: the term is loosely applied to all sorts of progressive movements and ideas, stretching from the late 15th century to the early 19th. However, if any set of values counts as typical of the Enlightenment, they are tolerance, intellectual caution, the questioning of authority and the disentangling of morality from religion.

If anyone deserves credit for promoting these values with unparalleled vigour, it is Pierre Bayle. It is a pity that he turned out not to be immortal, because the battle for them can hardly be described as won.

Anthony Gottlieb’s “The Dream of Enlightenment: the Rise of Modern Philosophy” will be published by Allen Lane on 30 August