believe it was because Kurama said it was because the Gedo Statue still "existed", which apparently gives him enough of a link and enough chakra and life-force to stay just barely alive, even if the Ten-Tails (which would include the statue) is sealed away inside someone else, this link apparently still remains as long as the Statue isn't sealed away like in a Catastrophic Planetary Devastation sense.
Then he got some extra life support from Black Zetsu, which also gave him access to Kurama's chakra since Kurama was inside Black Zetsu at the time (Kurama is even visible floating in the background on Obito's side of the magical chakra-plane when Obito grabs Madara's titty), and then he steals some Six Paths Sage power from Madara with his Rinnegan, giving him more chakra back, and then he also steals some of Shukaku and Gyuki's chakra to boot. So I guess the combination of the Statue still being around, and the unwilling support of Zetsu, and the Nine-Tails chakra, and the Six-Paths Sage chakra, and the One-Tails + Eight-Tails chakra, was enough to not only keep him alive, but get him back in fighting shape too.