As i have understood the character of Michael, he makes instant decisions.
So he decide to kill Fredo in Havana, when he gave the death kiss.
Why he wanted Fredo to come with him to leave Havana, is because he wanted to dig deep in to the motives and to find out who was behind this. Which he later did in the boathouse.

Fredo was dead for him in Havana.....