Then why didn't kaguya get the rinnegan? theoretically she should have more "pure" juubi chakra since she straight up ate the shinju fruit. even with a piece of the juubi's chakra she couldn't unlock it because she wasn't its host...
Hmm... You have a point.
Okay...
Hagoromo was NOT born with the Rinnegan. It became his kekkei genkai after absorbing the Juubi.
Eating Juubi fruit ≠ purest form of Juubi chakra
Purest form of Juubi chakra = sealing the Juubi inside of yourself
Rinnegan = having Juubi inside of you = having Senju and Uchiha DNA, which = very very close to purest form of Juubi chakra
Why didn't Obito and Madara get Rinnegans then? Very simple: Obito already had dojutsus, so there was no room for the Rinnegan in his right eye, and Madara didn't have a left eye without a dojutsu to even develop the Rinnegan.
I'll admit, I was wrong, but I'm 100% sure that ^ is right.