Do you think what Michael did to his older brother was justified to you in that circumstances and would you do it too if you were Michael?
-Yes. Fredo didn't leave Michael any other choice.
Fredo was not smart enough to do any harm to michael, after michael came to know about his betrayal. Just give him some mickey mouse hotel or better still, throw him out of the family business completely. Why kill him? Puzo did not want Fredo killed. It was copolla's idea. They settled with having him killed after their mother's death.
But to be fair with michael, he did not have the idea of killing Fredo after the New Year party. He apparently got the idea only before the pentangeli court hearing, where he has a argument with him(during which fredo says that his priority is first for himself and then the family).