The Ootsutsuki plotline is complete bonkers. Including aliens in the story was a big mistake and ruined the entire story creating massive retcons and plotholes.
In short, Madara should have been the final villain, Kaguya should not have been even considered.