Madara was the strongest character in the entirety of the series, clearly more powerful than even Kaguya if what she displayed is all she had. She could teleport through dimensions, he probably could've erased them if he put his mind to it. She was the worst way for him to go out, but, c'est la vie, that is the direction Kishimoto took things for some godforsaken reason.
I'm disappointed. We're now left with only Orochimaru and Sasuke as potential villains, but things are wrapping up really quickly, so it looks like Black Zetsu really was the final villain. What a weak way to go out. Maybe The Last will be better, I guess we'll see.