John F. Kelly, the chief of staff, summed up the prevailing mood in the West Wing: “God punished me,” he joked of his move there last summer.