Heres how i see it. The first and Madara had differing opinions and fought for whatever reason. Everyone seems to assume that Madara shoud've won since he has the MS, but we dont know anything about the batte, other then the location and the people involved.

Its far more likely that at the time Madara was a regular sharingan user, lost to the first, became a rogue and left the village, discovered the secrets of the sharingan/immortality, and set the kyuubi on konoha as revenge years later.