BLUF: I think that getting beaten and realizing he was wrong was the key to Madara being able to awaken the rinnegan before he died.
The reasoning behind this is:
1. Madara did not die at the Valley of the End after battling Hashirama.
2. Madara awakened the rinnegan shortly before dying. He apparently did not get a chance to use it against anybody in battle, since nobody mentioned that he had the rinnegan. If he had awakened the rinnegan with enough time and with the same level of hatred, he would have likely leveled Konoha like when Pain attacked.
3. Every evolution of the sharingan/rinnegan requires a significant emotional/traumatic event. I'm sure that everybody is familiar with the Naruto series knows how the different stages of the sharingan are initially activated, so I will not list them here. If all other evolutions of the eyes requires a stressful/emotional/traumatic incident, it should be safe to assume that awakening the rinnegan from the MS/EMS requires a similar experience. We know that Madara really did not have any friends after his battle with Hashirama (since most people thought he was dead) and his brother was killed before the battle, so he would need some other emotional experience to awaken the rinnegan. I think that the only major emotional experience left for Madara would have been to realize that he sacrificed everything (his position, his relationship with his village and people, and essentially his entire life) in order to obtain power, and that he was wrong.
4. Sasuke will eventually awaken the rinnegan. The theme of Naruto has been that younger generations always surpass their predecessors. Naruto has already shown that he has surpassed the previous generation. It has been hinted that Sasuke has some new ability, but he is due for a power up as well. At some point he will need to surpass Madara, which would require him to awaken the rinnegan.
5. Naruto is not going to kill Sasuke. Naruto is not going to die. It goes against Naruto's whole personality. He has gone pretty much the entire Manga without killing anybody, and he goes out of his way to save people. Naruto is not going to die (or if he does he will be resurrected soon after his death). If Kishi did not kill of Gaara after he was supposed to die, he wouldn't kill off the title character. Naruto's whole purpose in life is to become Hokage, and it will be extremely anticlimactic for him to die before he does it.
6. In Chapters 560-565, Edo Madara does not show the same level of animosity toward the world, Konoha, etc. as Tobi (or even as much as he used to when he was alive). He still seems hostile and dropped two meteors on the allied forces, but most of his techniques appear to be done out of curiosity into his current capabilities. He used phrases like "try" and "test" whenever he did a new offensive technique. His Susanoo and rinnegan activation were used in the battle as defensive techniques. Overall though, from the legends and stories, if he really wanted to, Madara should have been able to destroy the allied forces.
7. We don't actually know what Madara's intensions are. We assume that Tsuki no Me Keikaku was originally Madara's plan since it is Tobi's stated plan. However, we don't even know what Tobi is planning. Everything that we know about Madara is either from Tobi or passed down through stories and legends around the various villages. Plus, Madara seemed pretty upset with Kabuto about being resurrected, a non-Uchiha knowing about the Uchiha tablet, Kabuto implying that he made Madara more powerful when he was resurrected, etc.
8. Most of the resurrected shinobi really don't want to beat the allied forces (except for the truly sick in the head ones). For instance, the Second Mizukage refused to just give up in order to test the allied forces.
9. Continuing from number 3, another theme in Naruto is that real power comes from friends, family, etc. Chapter 552 is dedicated completely to the theme of teamwork and friendship. In Chapter 572, the So6P states that the reason that the tailed beasts were given separate forms and names is to give them time to find out what "true power" is.
I can see Madara coming to the realization that he dedicated his life to the pursuit of physical strength shortly before he dies and having an emotional ("oh S**t!!) breakdown.
I know that Kishi probably has more twists and turns in store for us, but I was curious as to what your opinions on this are.
The reasoning behind this is:
1. Madara did not die at the Valley of the End after battling Hashirama.
2. Madara awakened the rinnegan shortly before dying. He apparently did not get a chance to use it against anybody in battle, since nobody mentioned that he had the rinnegan. If he had awakened the rinnegan with enough time and with the same level of hatred, he would have likely leveled Konoha like when Pain attacked.
3. Every evolution of the sharingan/rinnegan requires a significant emotional/traumatic event. I'm sure that everybody is familiar with the Naruto series knows how the different stages of the sharingan are initially activated, so I will not list them here. If all other evolutions of the eyes requires a stressful/emotional/traumatic incident, it should be safe to assume that awakening the rinnegan from the MS/EMS requires a similar experience. We know that Madara really did not have any friends after his battle with Hashirama (since most people thought he was dead) and his brother was killed before the battle, so he would need some other emotional experience to awaken the rinnegan. I think that the only major emotional experience left for Madara would have been to realize that he sacrificed everything (his position, his relationship with his village and people, and essentially his entire life) in order to obtain power, and that he was wrong.
4. Sasuke will eventually awaken the rinnegan. The theme of Naruto has been that younger generations always surpass their predecessors. Naruto has already shown that he has surpassed the previous generation. It has been hinted that Sasuke has some new ability, but he is due for a power up as well. At some point he will need to surpass Madara, which would require him to awaken the rinnegan.
5. Naruto is not going to kill Sasuke. Naruto is not going to die. It goes against Naruto's whole personality. He has gone pretty much the entire Manga without killing anybody, and he goes out of his way to save people. Naruto is not going to die (or if he does he will be resurrected soon after his death). If Kishi did not kill of Gaara after he was supposed to die, he wouldn't kill off the title character. Naruto's whole purpose in life is to become Hokage, and it will be extremely anticlimactic for him to die before he does it.
6. In Chapters 560-565, Edo Madara does not show the same level of animosity toward the world, Konoha, etc. as Tobi (or even as much as he used to when he was alive). He still seems hostile and dropped two meteors on the allied forces, but most of his techniques appear to be done out of curiosity into his current capabilities. He used phrases like "try" and "test" whenever he did a new offensive technique. His Susanoo and rinnegan activation were used in the battle as defensive techniques. Overall though, from the legends and stories, if he really wanted to, Madara should have been able to destroy the allied forces.
7. We don't actually know what Madara's intensions are. We assume that Tsuki no Me Keikaku was originally Madara's plan since it is Tobi's stated plan. However, we don't even know what Tobi is planning. Everything that we know about Madara is either from Tobi or passed down through stories and legends around the various villages. Plus, Madara seemed pretty upset with Kabuto about being resurrected, a non-Uchiha knowing about the Uchiha tablet, Kabuto implying that he made Madara more powerful when he was resurrected, etc.
8. Most of the resurrected shinobi really don't want to beat the allied forces (except for the truly sick in the head ones). For instance, the Second Mizukage refused to just give up in order to test the allied forces.
9. Continuing from number 3, another theme in Naruto is that real power comes from friends, family, etc. Chapter 552 is dedicated completely to the theme of teamwork and friendship. In Chapter 572, the So6P states that the reason that the tailed beasts were given separate forms and names is to give them time to find out what "true power" is.
I can see Madara coming to the realization that he dedicated his life to the pursuit of physical strength shortly before he dies and having an emotional ("oh S**t!!) breakdown.
I know that Kishi probably has more twists and turns in store for us, but I was curious as to what your opinions on this are.