We must not underestimate the sheer intelligence Madara showed us with this. For most of us common folk, it wastes a lot of money to undergo a gender changing operation in real life. Madara got one for free, which shows us how opportunistic and pragmatic Madara really is, and how meticulously he planned this. In other words, BZ didn't manipulate Madara, but rather, Madara manipulated BZ into giving him a gender change! It was Madara's plan from the beginning. Why did he want to become a female? Because he's a massive masochist along with being obsessed with power/powerful opponents, and apparently females have a higher pain tolerance than men, especially during pregnancy. That way, he could laugh at a greater amount of pain(because even the biggest masochist has his limit). And Madara got 9 bijuu rasenshurikens to the face while Kaguya took over his body to laugh at. Ty, and Madara rules.