"That the prophet preached certain doctrines and predicted that we would find in them spiritual comfort only proves his sympathy for the human nature and his knowledge of it ; but it doesn't prove his superhuman knowledge of theology." — William Cllifford, The Ethics of Belief, 1877.
In that short but fundamental essay, Clifford sets up the principle for an ethical atittude towards beliefs: the most crucial question, the most important question to ask is not to know whether such a belief leads us to act well, or is useful or makes one feel good; it is not to know whether the prophet's teachings will improve society as a whole — the essential question is "how could he possibly know whether what he preaches is the truth?" This is a question rarely asked, but within that framework, it is the only relevant one, because it is the one that determines the ethical validity of believing. It leads Clifford to formulate the following princile : "It is wrong always, everywhere, and for anyone to ignore evidence that is relevant to his beliefs, or to dismiss relevant evidence in a facile way."
Later pragmatists (notably James in 1896) will strongly oppose that view, but as Russell explained (Bertrand Russell, Why I am not a Christian, 1957), adhering to a belief for its measurable advantages is neither ethical nor grounded on any kind of attraction towards truth, as efficiency is unrelated to morality (if not opposed to it). It is calling "true" what isn't, and what we have no reason to think it might be, just for the benefits of it.
More reading : [link]