Obama has met previously with Clinton.
Speaking to reporters after the meeting, White House Press Secretary Josh Earnest argued that a competitive Democratic primary was not a problem.
"That debate is good for our democracy," he said.
"It's also good for the party. And in the context of that debate, Sen. Sanders has had great success in engaging and even inspiring a large segment of the Democratic Party. That ability to engage Democrats and excite them and inspire them will be critical to the success of Democrats up and down the ballot, whether Senator Sanders is the nominee or not."
Sanders, who has made rebuilding the middle class a rallying cry of his campaign, went out of his way in talking to reporters to praise Obama's economic accomplishments, citing statistics about the dire financial outlook he inherited.
"So it is absolutely fair to say, and I say it every day, that we have got to do a lot better to protect the middle class and working families, but it's also important to remember how far we have come in the last seven years under the leadership of President Obama and Vice President Biden," he said.
David Simas, assistant to the president and director of the White House's Office of Political Strategy and Outreach, said in an interview Wednesday that given Obama's popularity with both Democratic primary and general election voters, he was confident the president would end up campaigning for whoever wins the party's presidential primary.
"Whoever the Democratic nominee is going to be is going to view the president as a critical asset, and someone they are going to want to see on the campaign," Simas said. "So once there's a nominee, that's where the important conversations are going to be."
Sanders said both Obama and Biden have been fair to him and Clinton, despite some recent suggestions by the media that the president has his thumb on the scale for Clinton.
"What the president has tried to do, what Vice President Biden has tried to do, is to be as evenhanded as they can be," Sanders said.
The idea of the meeting between Obama and Sanders was raised when the two men talked at last month's Congressional Ball, Earnest said.
"Obviously, the president has had a pretty busy schedule over the last couple of weeks and Senator Sanders has, too," he said.
"But this is a meeting that, you know, came together in the last week or two and, you know, the president was pleased to have the opportunity to sit down with Senator Sanders today. . . . There is value in having those kinds of conversations, and I suspect it's not the last one."
Several of Clinton's top aides have served in the Obama White House - including her campaign chairman John D. Podesta, communications director Jennifer Palmieri and senior policy adviser Jake Sullivan - and they periodically check in with the president's current staff on their policy plans and announcements. While there is no such overlap with Sanders' team, a White House official who asked not to be identified to discuss internal strategy said Wednesday, "Certainly there are discussions between the White House and the Sanders campaign."
The aide declined to specify the nature of those discussions.
Sanders, for his part, on Wednesday echoed his remarks from recent days in Iowa and suggested the race in Iowa will be determined by which candidate can better mobilise their voters.
"I think what the Iowa campaign ends up being about is one word and that is turnout," Sanders said. "We're feeling really good about where we are, and if there is a large voter turnout - now I'm not saying we can do what Barack Obama did in 2008, I wish we could, but I don't think we can - but if there is a large turnout, I think we win. If not, I think we're going to be struggling."
He also predicted he would do well in the New Hampshire primary and better than people expect in the next two contests that follow in Nevada and South Carolina.