In Naruto, it was said that you need both Senju and Uchiha DNA to achieve Rinnegan, right? So why didn't Danzo get Rinnegan? He had Senju DNA holding Uchiha DNA.
Well, that's becasue you also need to be competent enough to master both these powers.
Madara was strong enough, and was able to awaken it. Danzo however, was not.
Danzo's DNA originates from experiments and body modifications. He wasn't a "Natural", while Madara had natural mastery over the Uchiha powers, and after being defeated by Hashirama, mastery over the Senju powers.
It was also implied that you need to be very close to the end of your lifespan to awaken the Rinnegan.
Edit - Spoilers!
Based on the recent chapters, it is implied that it isn't Senju + Uchiha which is needed to awaken the Rinnegan, but Indra's and Ashura's (Sage of Six Paths' sons) chakras. That is why Madara (the incarnation of Indra) was able to awaken them after implanting Hashirama's (the incarnation of Ashura) cells into his wounds.
Danzo didn't awaken a Rinnegan because he is not a reincarnation of Indra. Even if he did, he only has the chakra reserves for like one or two moves. The manga and anime state that in order to awaken the Rinnegan without means of transplantation, one must possess a Sharingan, be Indra's reincarnate, take chakra from Ashura's reincarnate (these are Hagoromo, the Sage of Six Paths two sons) thus reforming Hagoromo's chakra, leading to the Rinnegan awakening. If a non-Indra reincarnate does what Danzo did, all he would get is Izanagi-spam, lesser cooldown on Kotoamatsukami wait, and Mokuton (wood style.)
Put simply, Danzo didn't awaken a Rinnegan because he isn't an Indra reincarnate.
Just in case you still don't understand, here's an image from the manga when Hagoromo himself explains how Madara awakened the Rinnegan.
Danzo was not able to awaken the rinnegan because he had senju DNA and Uchiha eyes but had neither enough chakra to effectively utilize either ability (hashirama' s wood style or the sharingan in his arms). While madara was an Uchiha who implanted hashirama's DNA throughout his whole body he did not awaken the rinnegan until he was near death. It would not be expected for someone like Danzo to be capable of manifesting the rinnegan, at least at the point in time that he was living.
Like many said, you kinda need the "blood" or "chakra" of the Uchiha and Senju to awakened, which many stated to be implied at the end of one's life. Danzo doesn't have any, only body modifications. Danzo had the Sharingan because he STOLE them, he ripped them out of the Uchiha who had them, therefore he will never awaken the Rinnegan. That's why he was bandaged, so it doesn't drain his chakra. It's not that Madara was strong enough, he basically had the requirements to do so, just at the end of his life did it awakened.
Nagato was implanted the Rinnegan at a early age by Madara before he died, and Nagato is of the Uzumaki, hence how he could easily handle the Rinnegan (I am sure if he had both Rinnegan or just the one).
Also, you need an EMS to evolve into the rinnegan unless you were born with it, which hagoromo was.We all know that even if you have senju and uchiha blood, you need the EMS to evolve into rinnegan. If hashirama wanted the rinnegan, he would have to transplant madara's sharingan to get it. If someone was the descendant of an incarnate of indra and also an incarnate of asura, he would be able to awaken the Sharingan, just the sharingan unless he was an incarnate of Asura.