Donald keeps saying "Crooked Hillary" has given Sanders a raw deal. Keeps mentioning how the system is stacked against Sanders. Trump has even went on to say that the Democrats have treated Bernie very badly and that he should go on and run as an independent. Well, the reasons for Trump pushing that scenario are obvious. After Sanders win in Indiana, Trump took to Twitter to congratulation him on his victory.
I would rather run against Crooked Hillary Clinton than Bernie Sanders and that will happen because the books are cooked against Bernie!
— Donald J. Trump (@realDonaldTrump) May 4, 2016
So even if Sanders does not run as an independent (which he has already stated that he will not), then Trump is moving to gain the votes from the independent voters which will become available, assuming that Hillary wins the primary over Sanders. Basically, this is a move to try to gain some goodwill from voters for the upcoming election. There is no risk involved as Trump has already determined that Hillary will definitely take the Democratic nominee over Sanders.
There is one similarity between Sanders and Trump. They are both anti-establishment, to a degree. That said, Sanders is not nearly as far away from his party as Trump is. If Sanders were to gain the nomination, he would do well within the party and do extremely well among independents and even gain some of the more progressive Republican votes.
Voters are tired of hearing about the money aspect of politics and these two candidates give different takes on how much money is involved. Though Trump and Sanders are very different from one another, they are both promising change when compared to Washington's inner circle.
So to sum it up, Trump is siding with Sanders just to try to gain some goodwill and to pick up some votes from independents and also Dems who are more open to actually open to voting for a Republican, based on their hate for Hillary. If possible, Hillary would certainly consider implementing a similar tactic.