They both shared similar fundamental values of the Shinobi World, but their differences lies in how they planned their goals; Nagato's goal of creating a weapon of mass destruction, in my opinion, was a better and should have been what the Shinobi Alliance fought against rather than Infinite Tsukuyomi. Nagato's goal seemed the real threatening than a Genjutsu. But both Nagato and Madara were great villains; both had had godlike power, both manipulated people and so on. I prefer Nagato over Madara, though. I felt Madara was just a copycat of Sasuke and Obito, whereas Nagato was an original villain.
And lol at anyone who said Madara wasn't Tnj'ed. He got Tnj'ed by Hashirama in the end, and agreed Hashirama's ideology was better than his.