Epstein would benefit by being released from prison without having to die. We can all agree that Epstein would prefer to be free, right?
So how could Epstein make others benefit from him being free? Well, he could pay them, or he could blackmail them. Let's explore the blackmail option a little. Epstein could have evidence against his jailers' bosses(trump or Barr) that he would have released if he really died. The release him, and he does not release the evidence.
There is another possibility, that trump and Barr did it as a favor to a close friend. Epstein was trump's only close friend, and was Barr's longest friendship, but neither seem like the types that would do favors for friends.
I see a motive, but I tend to think the simplest explanation is correct. Barr and trump let Epstein commit suicide to cover up their crimes.