The flashback highlights just how unhappy Bruno is at "Out-With." Under the circumstances, it's inevitable that he should start getting nostalgic for happier times back in Berlin. The flashback episode reveals just how uncomfortable Bruno's grandmother was with her son's wearing of the Nazi uniform. Bruno didn't understand why his grandmother was so sharply critical of Ralf then and still doesn't understand it now. He's still young and innocent and has an awful lot to learn.
But he does at least sense there's something not quite right about the uniform and what it represents—something that is somehow linked to his current unhappiness at "Out-With." Bruno doesn't know the full story yet, and tragically won't know until it's too late. For now, he does know that both he and his grandmother are profoundly unhappy at Ralf's new posting, so Bruno decides to write to his grandmother to let her know just how miserable he is. He's sure that she'll understand.