I think that Kaguya coming back as the bad guy is probably because she is...how to say, desperate? What I think is that, Kaguya has seen to much war and blood that she became desperate for peace; like she is really scared of another war. At first she got a momentary peace through making people fear her but the people started rebelling and started another war. And Kaguya, whose sanity has already started slipping since eating the fruit, finally snapped and lost all hope in humanity. Eventually, she might have think that 'Since the humans wanted to be in that nightmare (war) so much, then I would give it to them' and so began her plan to throw every living being into an endless nightmare?
But since she is dying, she might have also used the will thing Madara used on Zetsu and implanted it somewhere, and that will somehow got stuck on Madara and Madara transferred it to Zetsu. B.Zetsu would most likely be the one to, not sure, Use Madara as a human sacrifice for Kaguya to be revived and such. So, I don't think that Madara would be turning into Kaguya or having a Kaguya in Madara's body, because Madara acting like a girl totally give me nightmares. I really hope that Madara is only used as a sacrifice, or else his body must be altered, completely.
That is only what I think though.