Centuries ago, there was no confusion over who was on whose side during a war. Soldiers often wore brightly colored uniforms that distinguished them from their opposition, and so the chances of being confused for an enemy soldier were minimal. Since the transition to comparatively more modern warfare, that's changed.
Uniforms during the Second World War were broadly the same color on every side, and the constant built up of mud and blood only added to the confusion. Therefore, if you spoke in a foreign tongue, you'd be assumed to be an enemy. You might recall a scene in the film where two men shout something in a foreign language before being shot, presumed to be German soldiers. They're actually Czech, and were shouting 'Please don't shoot me, I am not German, I am Czech, I didn't kill anyone', but tragically nobody can understand them, and they're executed. Such incidents were sadly not uncommon during the war.