He's not a bad guy, he is a product of his time and upbringing.
You have to remember that this is a manga were children are trained up to be killers. Can anybody honestly call a child-soldier a bad person?
When the United States firebombed Tokyo and nuked Hiroshima and Nagasaki, hundreds of thousands of civilians had a really really bad day. Had the United States lost the war it would have been very likely that the Generals who ordered those attacks would have been sentenced to death for crimes against humanity.
But they won, so it was the Germans and the Japanese who are known for being the "bad guys" in regards to that conflict.
Madara, former child-soldier is warring with other former child-soldiers. If he wins then he's a hero and a messiah that brought peace to the world, if he loses he's the hated reviled villain.
It's a question of pragmatism really. And Madara is the most pragmatic motherf***er on the field right now.