Obito isn't immature. Losing a loved one is scientifically proven to be one of the most stress inducing events that can happen to someone. Just because it takes place in a world where genocide happens every week and everyone and their uncle get tortured and abused with some age old curse doesn't make Obito immature for the death of the girl he cared for.
Plus you think his only reason is Rin? Obito polluted Sasuke in the same way Madara polluted Obito. Obito never exactly had an easy life even before he 'died'