I find it odd that no one else has interpreted that scene the way I did, but I believe the reason that he leaves is for revenge.
Walt has been trapped on that ranch for months on his own, without any contact with the outside world. We know that, because he pays the guy who put him into hiding $10,000 to stay with him a little longer, just because he wants some company.
So when Walt finally ventures off the ranch and goes down to the bar, after he has spoken to his son, he decides to turn himself in because he is dying and he has nothing else to live for.
However, whilst he is watching the interview, the interviewer explains at one point that blue meth is still being distributed through the south-west, and that Heisenberg is still at large.
Walt knows that there is only one person who could make the blue meth to a standard that would be mistaken for his own, and that is Jesse. And the last time he saw Jesse was when he was supposed to be killed by the White Supremacist gang.
This is the first he would ever know of this, because as soon as Jesse was taken, Walt went into hiding, and had zero contact with the outside world since then.
He realizes that they never killed Jesse, and are now using him to cook the meth, and selling it as Heisenberg product. He realizes that before he turns himself in to help his family, there is someone else who he needs to help: Jesse.
I don't think he really cares about being disassociated with Grey Matter, his legacy now is Heisenberg. That is what is currently being taken away from him. This is why he chooses to stay by all of the meth cooking equipment in the final scene, so that he will be found and everyone will know that he is Heisenberg, and will think that it was him cooking the meth for all of that time.
Making Gretchen and Elliott give his money to Junior as a charitable donation was simply the icing on the cake. He finally managed to get his money to his family, and also got to confront his old partners and show them that he was more powerful than them, but if that was what he initially went back for, he could have done that and then gone back into hiding, gone and lived the rest of his days on an island or whatever.
His main priority was to retrieve his legacy, to die as Heisenberg, powerful and in his prime, instead of as Walter White, old and alone in the middle of nowhere. That's why he tells Skylar that he cooked the meth for himself, he was telling her who he had become over the past 2 years, and he also managed to help her out for all the terrible things that he had done to her and his son.
Whether he let Jesse leave because he realized he'd done a terrible thing to him, or to make sure that he didn't take any credit for cooking the meth is open to interpretation.