Obama, who was accompanied by his wife Michelle, also praised the relatives for efforts to promote tolerance in the wake of the attack late last night.
The mass shooting on December 2 left 14 people dead and 22 wounded in what is being investigated as a terror attack.
Obama stopped in California en route to Hawaii for a family Christmas vacation, spending nearly three hours with those who lost loved ones and first responders who rushed to the scene of the rampage.
"And as we go into the holiday season, even as we are vigilant about preventing terrorist attacks from happening, even as we insist that we can't accept the notion of mass shootings in public places and places of work and worship, we have to remind ourselves of the overwhelming good that exists out there."
More From This Section
Speaking at Indian Springs High School, Obama added that despite what they were going through, the families "could not have been more inspiring, and more proud of their loved ones, and more insistent that something good comes out of this tragedy."
"It was a reminder of what's good in this country."
The carnage at a social services center was carried out by US-born Syed Farook and his Pakistani wife Tashfeen Malik.