Voltaire, the most famous intellectual of Rousseau's day, rejected traditional religion, but he believed in a divinely ordered universe, and in rational morality as a divinely plotted cause that could transform human life for the better. This rational, reformist religion is known as deism.

Rousseau, too, was a deist – but he wanted to turn this outlook upside down. Conventional rationalism was conservative; it sucked up to the rich, flattering their (self-interested) interest in reform. Voltaire, so very at home in posh drawing-rooms, embodied this. Rousseau saw the need for a bigger, bolder story about social transformation, about the restoration of true humanity.

So, in the 1750s, he put forward his big story. In his Discourse on Inequality he floated the idea of "the state of nature", an original form of human life in which "natural compassion" held sway, ensuring fundamental equality. With civilisation, this primal equality disappeared, chiefly because property was invented. But the fall from grace is not complete – our essential nature remains good.

The state of nature was a thought-experiment. As he put it, it is "a state that no longer exists, perhaps never has existed, and probably never will, of which one must nevertheless have an accurate idea in order to judge our present state properly".

If we want to reform our world, pragmatic rationalism is not enough: we need this bold vision, of full humanity regained. We can try to rethink society in the knowledge that this basic purity exists; we can try to maximise it.

But what is "full humanity"? How does Rousseau know that this potential exists? Ultimately it's a religious conviction: he insists that we are made in God's image. We know it by looking in our hearts, he says – but, of course, such looking is determined by religious thinking. Other deists talked of reason as a divine force in humanity. For Rousseau, it's humanity that's divine, not reason.

His next work, Discourse on Political Economy (1755), was a more detailed attack on economic injustice. Wealth gravitates upwards; the rich ensure that the law entrenches their massive advantage, inventing lucrative public-sector jobs, and tax-breaks, for themselves. (I hesitate to anoint Simon Jenkins the new Rousseau, but his column this week was about exactly this.) And of course: "When a man of high standing robs his creditors or cheats in other ways, is he not always certain of impunity?"

Rousseau's solution was to instil the ideal of the common good in everyone, from birth: drum, drum, drum it in.

In The Social Contract (1762), he argues that the only truly legitimate state presupposes the liberty and equality of its citizens. This, he sees, runs into a problem: we have lost our "natural liberty". We cannot recover it. We must instead seek "civil liberty". Enlightened, participatory politics becomes the only possible arena in which we can realise our nature.

So "liberty" cannot mean freedom to do as one wants; it must mean blending in with the "general will", which has an absolute right to command us.

This rhetoric of the general will is widely seen as deeply sinister, the seed of totalitarianism. This is unfair: his aim is to formulate a new conception of politics, one that enshrines liberty and equality – and this surely needs a bold account of the state's authority (social democracy takes such authority for granted).

What's the place of religion in the ideal state? His answer is surprisingly nuanced. Because the state needs a high level of ideological unity, the ideal religion would seem to be one that fully served this political end, as most ancient religion did. Of course, Christianity is not suited to this; it disparages secular political goals, and its teaching extends sympathy to outsiders.

Should we revert to a religion of state-power-worship? No, it would be false and oppressive, and would also lead to an aggressive foreign policy. He proposes a sort of two-tiered approach: there should be a minimal form of religion, or quasi-religion, concerned with loyalty to the state – "civil religion". The articles of this faith should be seen "not precisely as religious dogmas, but as sentiments of sociability, without which it is impossible to be a good citizen or a faithful subject".

Beyond this, people should be allowed to believe what they want, which will probably be some form of universal morality. This is no blueprint for totalitarian state religion. It's a pretty accurate prediction of the secular liberal state, which promotes certain common values and leaves other forms of belief to our discretion.