"The most successful CEOs I know didn't start out intent on making money - rather, they had a vision of how their product or service would change things, and the money followed," he said.
For those headed to medical school, Obama said "make sure you heal folks in underserved communities who really need it, too." He asked those headed to law school to think about defending the poor.
Rain drenched the audience gathered in Atlanta for the outdoor ceremony before Obama arrived, forcing many guests to wear clear plastic ponchos over what amounted to Sunday-best clothes. Rain began to fall again, and thunder clapped, minutes after Obama began his address.
"I also have to say you all are going to get wet," he said. "I would be out there with you if I could. But Secret Service gets nervous, so I'm going to have to stay here, dry. But know that I'm with you in spirit."
The speech was Obama's second commencement address of the season, following remarks last Sunday at Ohio State University in Columbus. His third and final graduation address will come Friday at the U.S. Naval Academy in Annapolis, Md.
At Morehouse, Obama also urged graduates to "inspire those who look up to you to expect more of themselves." As America's first black president addressing a predominantly black audience, Obama also talked about his personal story, growing up without a father he wished had been around and involved, and his desire to a better father to daughters Malia and Sasha than his father was to him.
"We know that too many young men in our community continue to make bad choices," he said. "Growing up, I made quite a few myself. Sometimes I wrote off my own failings as just another example of the world trying to keep a black man down. I had a tendency sometimes to make excuses for me not doing the right thing. But one of the things that all of you have learned over the last four years, is there's no longer any room for excuses."
"I understand there's a common fraternity creed here at Morehouse: excuses are tools of the incompetent, used to build bridges to nowhere and monuments of nothingness," he said. "Well, we've got no time for excuses - not because the bitter legacies of slavery and segregation have vanished entirely; they haven't.
"Not because racism and discrimination no longer exist; we know those are still out there," he added. "It's just that in today's hyper-connected, hyper-competitive world, with millions of young people from China and India and Brazil, many of whom started with a whole lot less than all of you did, all of them entering the global workforce alongside you, nobody is going to give you anything that you haven't earned."
"And moreover," the president said, "you have to remember that whatever you've gone through pales in comparison to the hardships previous generations endured and they overcame, and if they overcame them, you can overcome them too."
About 500 students received undergraduate degrees from the historically black, all-male institution in Atlanta, becoming "Morehouse Men."
After the speech, Obama was to attend a Democratic Senate fundraiser, also in Atlanta.