When President Barack Obama praised conservatives Charles and David Koch for their efforts to overhaul the criminal-justice system, laughter rippled through the crowd Tuesday at the annual convention of the National Association for the Advancement of Colored People.

“No,” Mr. Obama said, “You’ve got to give them credit. You’ve got to call it like you see it.”

Mr....