Quote from brid
I mean his left eye. (I agree with you on the right eye.)
Tobi claimed he gave Nagato the Rinnegan, and his fight with Konan was to get the eyes back. (It was one of the main "plothole" objections as to why Tobi couldn't be Obito because he wasn't born when Nagato awakened the Rinnega ...
When he claimed to have given the Rinnegan to Nagato he was pretending to be Madara and since there seems to be a connection between Obito and Madara it is likely Madara gave Nagato the eyes and Obito playing Madara would of course adopt his actions as his own.