When compliance officers at JPMorgan Chase conducted a sweep of their wealthy clients a decade ago, they recommended that the bank cut its ties to the financier Jeffrey E. Epstein because his accounts posed unacceptable legal and reputational risks.

Yet Mr. Epstein, who had been charged with sex crimes and pleaded guilty in 2008 to solicitation of prostitution, remained a JPMorgan client until 2013.

The main reason, according to six former senior executives and other bank employees familiar with the matter, was that Mary C. Erdoes, one of JPMorgan’s highest-ranking executives, intervened to keep him as a client.

Part of her rationale was that Mr. Epstein played a lucrative role recruiting new customers to JPMorgan’s private-banking division, which caters to ultrawealthy people and families, the six employees said. That made him an especially coveted client.