He called his listeners to "prove" themselves worthy of this grace by waking up "to the way past injustices continue to shape the present", by considering what "causes so many of our children to hate".
And he said "God's grace" would be expressed by doing something about the 30 people cut down every day by gun violence.
Pinckney and the eight other black worshippers were slaughtered last week at the historic Emanuel African Methodist Episcopal Church in Charleston.
Their white alleged killer had joined the prayer and Bible service for an hour before shooting them.
Black politicians, rights activists and conservative Republicans pointed to the Confederate flag that still flew in an unofficial capacity at the state capital as a reminder of the South's history of slavery and "of systematic oppression and racial subjugation", Obama said.
Within days of the deaths, the flag started being pulled off the virtual and real shelves of Walmart, Sears, eBay and Amazon.com, and even the gift shops of some national parks.
South Carolina Governor Nikki Haley called for its removal from the state capital, and the state of Mississippi launched a move to remove its embedded image from its official state flag.
- AAP