Well, a theme that runs through the film is justice, so that's why. Remember when everyone is going to leave the hotel, and Will says "we can leave too". Dan replies that Doc Potter didn't give his life for nothing. At the end of the film it's clear that Dan didn't give his life for nothing either. Ben Wade realizes this, and has come to respect Dan through getting to know him. He knows he's a bad person and deserves to go to jail, and he also acknowledges that A) his gang doesn't deserve to live, they're no better than him (in fact, Charlie Price is probably worse), and B) If he doesn't get on the train, then Dan died for nothing. I believe by this point Ben considers them friends, or at least men of respect for each other, and he won't allow Dan to be forgotten again.
On a side note, Ben Wade is not afraid of Yuma Prison. He's broken out twice, and he'll do it again.
The important thing for him is that the situation plays out justly, and that when everyone else was running away, Dan and Will were the only ones who stayed to do the right thing.
Also
His horse starts runing along the train hinting that he isn't going to make it to Yuma prison. He did right by geting on the train, Dan never agreed to get him to prison.
On a side note, Ben Wade is not afraid of Yuma Prison. He's broken out twice, and he'll do it again.
The important thing for him is that the situation plays out justly, and that when everyone else was running away, Dan and Will were the only ones who stayed to do the right thing.
Also
His horse starts runing along the train hinting that he isn't going to make it to Yuma prison. He did right by geting on the train, Dan never agreed to get him to prison.



