I just read an article by a barrister arguing that it was an anachronism to swear oaths in court, and unjustly privileged the religious. Instead, he claimed, everyone should solemnly affirm by whatever they most highly value, which is all that an oath comes down to, anyway.

I take it he does not practice at the criminal bar.

His speciality in ethics seems too high-minded for that. Because it's obvious that the great majority of people who perjure themselves in court, or who lie under affirmation, do so precisely to protect something that they value greatly. There must be the occasional psychopath who lies in court just out of habit, or for the sheer hell of it, but most lying witnesses and perhaps all lying defendants have much more practical motives.

Now, it's no use whatever to say that people ought to value other things – let's call them values, for short – rather than their own self-interest. Perhaps they ought to, but they often don't. If all the courts had to deal with were honest misunderstandings there would be very little need of law. Nor is it clear where this binding "ought" comes from in the first place. (For the avoidance of predictable comments, I am not claiming that the "ought" must come from religion; just that it doesn't come from reason). It's hard to see how you could persuade a dedicated follower of Ayn Rand, for example, that it is wrong to lie in court even when telling the truth would have unpleasant consequences.

But there's a little Randian in all of us. In each of us, there is a moral battle between honesty and its opposite, or selfishness and its opposite. And the outcome is to some extent determined by entirely selfish factors. We ask, will we get away with it. The morality of a really common crime like speeding is not affected by the presence of speed cameras but its prevalence certainly is.

In cases where we can't calculate our advantage accurately we fall back on habits, short cuts and prejudice. Quite right too. It's a great weakness of individualistic rationality to pretend that we don't or shouldn't do this. In fact Hume's remark that "Reason is, and ought to be, the slave of the passions" is the only view of morality that makes sense in the light of evolution.

Society needs reasons for people to tell the truth even when it is to their disadvantage. But in plural societies, like ours, we do not know the particular reasons that will work for each witness or defendant. What's needed here is not something merely valuable, but even more valuable than our perceived self-interest.

This is rare but can usually be found. Almost everyone has some uneasy sense that there are things which are – if not more valuable than their own self-interest – more powerful. And for religious believers, this is expressed in religious beliefs. It's entirely wrong to suppose that religious beliefs are merely stories about the universe. They are also, and at least as importantly, something that economists would recognise as a utility function, and the rest of us call a statement of values. They bring to life the claim that some things outside us are more important than we are.

These things vary between religions and atheisms. You can solemnly affirm as well as swear by God, by the revolution, or even by the jackal-headed Anubis. But in a plural and individualistic society we have to face up to the fact that many of these individual sacred values are pretty much worthless for somebody else. Even if almost everyone has some "sacred" value it is in the nature of sacred things that they are particular. If they are translated into pieties too general, that anyone can sign up to, they lose their moral force.

Binding moral claims appear as statements of value that are also, simultaneously and inextricably, statements of fact. Even when an outside observer can see that the values are pretty much the same, you can't overlook the discordance of the facts. A humanist who swears on the Bible will think it's just flummery and be no more compelled to truth by it than if they swore on a stack of Tatlers. The opposite would be true for a believer.

So the courts must allow people who believe in God to swear in front of him just as they must allow atheists to affirm by whatever they believe in. That doesn't guarantee that either will tell the truth. But it's no solution to pretend that everyone is really an atheist deep down.