"It sends a message that when you have been given a privilege to serve, if you do things that are untoward, no matter what position you serve in, you are no higher than the law", said Lumumba.
The first black president of the United States had been invited to pay tribute to South Africa's first black president to mark the 100th anniversary of Nelson Mandela's birth.
But, Mr Obama added: "I can't find common ground if someone says climate change is not happening when nearly all the world's scientists say it is".
Since leaving the White House, Mr Obama has largely avoided direct involvement in USA politics and has refrained from criticising Mr Trump.
Obama speaks to Nelson Mandela's widow Graca Machel during the memorial service for the former South African president at the FNB Stadium in Soweto near Johannesburg on December 10, 2013.
While not directly mentioning his successor, President Donald Trump, Obama's speech in South Africa was expected to counter many of Trump's policies, rallying people to keep alive the ideas that Mandela worked for, including democracy, diversity and good education for all.
The "politics of fear, resentment, retrenchment" are on the move "at a pace unimaginable just a few years ago", Obama added.
"It should make us hopeful‚ but if we can't deny the real strides our world has made since that moment when Madiba took steps out of confinement‚ we have to recognise ways in which the global order has fallen short of its promises".
He acknowledged that it would be easier to be cynical and say the new political force was too powerful to resist, but urged people to rather look to Madiba's vision and example of working "collectively" with others to make an impact.
"Everyday I read the newspaper and just think like 'Brothers, what's wrong with you guys?" "We see it in the utter loss of shame in political leaders - where they utter a lie and then just double down and lie some more".
Obama told the crowd he enjoyed the more informal setting of town halls as he often saw ambitious "kindred spirits" who were "doing fantastic things but so often feel isolated" and lacked the framework to take their ideas forward.
"We are taking this moment to inculcate Mandela's selfness and service in our everyday values", Prof Mollo said yesterday.
His comments are seen as thinly veiled criticism of the current USA administration's use of what has been described as "alternative facts".
Here are five key points from his Nelson Mandela lecture, made to the world's media and an audience of some 15,000 people in South Africa's main city, Johannesburg.
Ramaphosa said South Africans celebrated Obama because he shared similar leadership qualities as Mandela and had the same ability to inspire hope and action.
Mandela was imprisoned under apartheid rule in 1962 and only freed in 1990 when he went on to lead the African National Congress party to victory in the first multi-race elections in 1994.
In a clear reference to Mr. Trump's repeated claim that climate change is "a hoax", Mr. Obama said it is impossible to "find common ground" if a politician ignores the consensus of nearly all scientists.