LAKE FOREST, California (CNN) -- Speaking to a group of evangelical Christians, Sen. Barack Obama said Saturday that his greatest moral failure -- and the country's -- has been selfishness, but his opponent, Sen. John McCain, cited his failed first marriage.

McCain, the presumptive Republican presidential nominee, added that the country's greatest shortcoming has been a tendency to not devote itself "to causes greater than ourselves."

"I think after 9/11, my friends, we should have told Americans to join the Peace Corps, expand the military, serve a cause greater than your self-interest," he said.

Obama told the Rev. Rick Warren that "we still don't abide by that basic precept of Matthew: that whatever you do for the least of my brothers, you do for me.

"That basic principle applies to poverty. It applies to racism and sexism; it applies to not thinking about providing ladders of opportunity for people to get into the middle class."

The Saddleback Civil Forum on Presidency was the first time both candidates appeared on stage since they became the presumptive presidential nominees for their parties. Watch the complete forum:Part 1 », Part 2 », Part 3 », Part 4 »

The event was held at Saddleback Church, a mega-church in southern California. The candidates were interviewed by Warren, pastor at the church and author of the best-selling book "The Purpose-Driven Life."

Warren has said he won't endorse either candidate, preferring that his followers make up their own minds.

Miss it the first time?

John McCain and Barack Obama in a forum hosted by Rick Warren. Catch the replay on CNN.Sunday, 8 p.m. ET

"I have to tell you up front, both of these guys are my friends. They both care deeply about America. They are both patriots," Warren said in his introduction. "They have very different ideas on how America can be strengthened." Watch analysts break down the event »

McCain and Obama appeared briefly onstage together, shaking hands and posing with Warren between their one-hour interviews.

Obama acknowledged his drug and alcohol use as a teenager when asked about his personal failure.

McCain's answer to the question on his own failings was succinct. "My greatest moral failing, and I have been a very imperfect person, is the failure of my first marriage," he said. Watch more of McCain's interview »

When asked what faith in Jesus means to him, McCain replied, "Means I'm saved and forgiven. Our faith encompasses not just America but the world."

McCain got teary-eyed while discussing an experience with a guard during his experience as a prisoner of war in Vietnam. The guard, McCain said, drew a cross in the sand while he was praying on Christmas Day. "For a minute there, we were just two Christians worshipping together."

Neither candidate shied away from a question about which current Supreme Court justice they would not have nominated.

Don't Miss

"I don't think he was a strong enough jurist or a legal thinker at the time for that. I profoundly disagree with his interpretation" of the Constitution, he said.

McCain said he would have never nominated Justices Ruth Bader Ginsburg, Stephen Breyer, David Souter and John Paul Stevens.

"This nomination should be based on the criteria on a proven record of strictly adhering to the Constitution and not legislating from the bench," McCain added.

The Arizona senator said he was "proud" of President Bush for nominating conservative Justices Samuel Alito and John Roberts to the court.

McCain also touched on the conflict in Georgia, saying Russia's behavior in sending troops into breakaway regions "is not acceptable in the 21st century."

"They achieved a revolution. ... Now the Russians are coming in there in an act of aggression. ... We have to not only bring about cease-fire; we have to have honor," he said, adding that Russia must respect Georgia's sovereignty.

Warren pressed Obama on two hot-button issues among social conservatives: abortion and same-sex marriage.

Obama said that although he's pro-choice and supports Roe v. Wade, his goal is to reduce the number of abortions in America.

He also touched on same-sex marriage. When asked to define marriage, he told Warren, "It's a union between a man and a woman."

"For me as a Christian, it is a sacred union. God's in the mix," he said.

Obama added that he does support same-sex civil unions, saying, "I can afford those civil rights to others even if I don't have ... that view."

McCain was also asked about his views on those issues. He said he would be a pro-life president and would support legislation favoring anti-abortion policy positions. Watch McCain discuss abortion »

In terms of same-sex marriage, he supports traditional marriage defined as a union between a man and a woman but would let states decide rather than have a federal mandate.

Obama was asked what he would say if he could say whatever he wanted and face no public repercussions. He answered, "solving big problems are not going to be easy. We are all going to think about how we using things [energy-wise]. If we pretend like everything is free, we are betraying the tradition of America."

The stakes are high for both candidates, who are actively courting so-called values voters and evangelicals, important voting blocs.

A CNN/Opinion Research Corp. poll taken July 27-29 showed that among white, born-again or evangelical voters, 67 percent are for McCain, with 24 percent for Obama.

Although it's a strong showing for McCain, he's lagging 11 percentage points behind President Bush in the 2004 election. Exit polls show that Bush beat Sen. John Kerry 78 percent to 21 percent among these voters.

McCain, who was raised an Episcopalian and now identifies himself as Baptist, rarely discusses his faith.

"I'm unashamed and unembarrassed about my deep faith in God. But I do not obviously try to impose my views on others," McCain said in April.

Since then, the senator from Arizona has met with many of the evangelical leaders who did not support his candidacy during the primary season. At a private meeting this summer, dozens of the movement's most prominent figures voted to support his campaign.

Obama's positions in favor of abortion rights and same-sex civil unions also have created tension among evangelical voters otherwise drawn to his candidacy.

But the Democrat, who is Christian, has made it a point to discuss his religion on the trail this year and launched an ambitious outreach effort targeting these voters, including private summits with pastors and a major campaign aimed at young evangelicals.