The president offered a new rationale for the costly, unpopular conflict: “God wants to see people taken care of,” he said.