US rivals try to woo Christians
The two men shared a stage for the first time since securing nomination.
Speaking first, Mr Obama defended his support for abortion and same-sex civil unions, but said marriage should only be between a man and a woman.
Republican John McCain affirmed he was pro-life and that he strongly supported preserving the status of marriage.
At the beginning of the first hour-long interview, Mr Obama told the pastor that America's greatest moral failure was its insufficient help to the disadvantaged.
The Democratic candidate noted that the Bible had quoted Jesus as saying: "Whatever you do for the least of my brothers, you do for me."
He said the maxim should apply to victims of poverty, sexism and racism.
Mr Obama also reaffirmed his belief that marriage should only be a "union between a man and a woman", although he also defended his support for same-sex civil unions and for the granting of similar rights to same-sex partners.
If he were president, he said he would not support a constitutional amendment banning gay marriage because the issue was one for state governments to decide.
On abortion, Mr Obama stressed he remained pro-choice and that he believed in the "Roe vs Wade" Supreme Court ruling supporting it.
However, he did say that he would seek to reduce the number of late-term abortions and unwanted pregnancies.
Mr McCain was asked similar questions by Mr Warren. When asked about America's greatest moral shortcoming, he responded by saying that its citizens had failed to "devote ourselves to causes greater than our self-interests".
When asked about his stance on abortion, the Republican candidate declared he opposed abortion "from the moment of conception".
"I will be a pro-life president and this presidency will have pro-life policies. That's my commitment to you," he said to applause.
Mr McCain also said he supported preserving "the unique status of marriage between a man and a woman" and that he was against the decision taken in some states to allow same-sex marriages.
"That doesn't mean people can't enter into legal agreements. That doesn't mean that they don't have the right of all citizens," he said.
Conservative Christians form about one-quarter of the US electorate. They largely support the Republican Party, but have not shown great enthusiasm for Mr McCain.
He identifies himself as Baptist and has made a strong appeal to social conservatives and evangelical Christians during his campaign.
But he rarely discusses his faith. Earlier this year he said: "I'm unashamed and unembarrassed about my deep faith in God. But I do not obviously try to impose my views on others."
The Illinois senator, a Christian, has made a point of discussing his religion on the campaign trail and has been courting religious voters with a presence on Christian radio and blogs, and other events. '
Seems to me that Obama's Christianity has as much relevance to his politics as did Blair's, that is no Biblical influence in the areas related to sexuality.