Plot. Sasuke obviously gave him some chakra as he was running around and doing Kamui. Him wanting to die was BS because he was needed as Kakashi said. But I guess being with Rin is more important than saving the world...
Everybody and their mother seems to forget that obito was already dying from the Juubi extraction. Literally would have used Inazagi just to snuff it 5 minutes later.