This is an interesting question for which I have only an idea, not an answer. I have taught this play, but I gained most of my insights through directing the play a long time ago. It is my suspicion that Anne has not crossed the line that allows her to see the full potential for horror in human beings. Her quote that she still believes that people are basically good at heart seems to be a product of someone unacquainted with evil. This seems odd since she is in a totally horrible situation, but I suspect that she approaches it with youthful hope that, no matter how horrible things appear, all will be well. As we (I) become older, we come into contact with evil on a more personal level, and it is harder to have her optimism.
This point of view is often attributed to a French statesman, Francois Guizot (1787-1874), who originally said, "Not to be a republican at twenty is proof of want of heart; to be one at thirty is proof of want of head."
The reason we read her story is, as I see it, the attempt to recapture the sense that things don't have to be the way they are.
I think it's also interesting to remember that she is in love, and this may do a lot for the way she sees things.
In her diary, after being in hiding, Anne is able to hold onto her optimism. It could be suggested that she was falsely cheerful and did not want to accept the horrors of life that awaited her and her family if they were discovered. It is amazing that the young girl had the patience and calm to write her thoughts as well as little stories to keep her mind occupied. Anne realizes that the Germans are her enemy. I am not sure she fully understands why though.
"Nice people, the Germans! To think that I was once one of them too! No, Hitler took away our nationality long ago. In fact, Germans and Jews are the greatest enemies in the world." Friday, 9 October, 1942, pg. 36
Even though she knows that the Germans are her enemy, she still has faith in the goodness of humanity.
"The July 15, 1944 diary entry ‘‘in spite of everything I still believe that people are really good at heart'' continues to be quoted in isolation, apart from the diarist's prior acknowledgment that ‘‘ideals, dreams, and cherished hopes rise within us, only to meet the horrible truth and be shattered.’’
Anne did not have bitterness in her heart, it would not be possible for her to write with such optimism if she did. I think she had faith in the future. She was very happy when she heard that the Allies were storming into France on D-Day. She thought of them as friends.