Gates told foundation employees he misjudged his relationship with Jeffrey Epstein, acknowledging it contradicted the institution’s values and posed reputational risk.