I know. I questioned myself in such the same way. The only conclusion that I came too is that I could prevent what happened, that it had to happen in the long run, even if it hurt us in the process.
From what I know, there was no way you could have known what Senator Palpatine was doing? From what I have learned there was no way you could have.
In terms of the prophecy, it might have come about in a different way but it did happen. For how could there have been balance in the Force when there was so many Jedi and so few Sith? As much as it disturbs me I do think the 'light' vs 'dark' side of the Force is what ends up ruining us. Instead it should be good vs bad. What you use the Force for instead of how you use it. While bad and hate are closely linked, it might not have to be.
He might have killed all those children, it hurts to think about. Yes it might seem as if we failed him and he betrayed us, in many ways he did but Palpatine manipulated him and used him to reach his own goals.
In the end, it turned out alright though. Look what Luke did. That is something to be proud of. If Anakin hadn't done what he did then Palpatine would have found someone else to use to meet his own ends and it could have been worse.