We were having a conversation in German and two teenagers, who were sitting behind us, shouted: “Uh, Germans!” when they heard us. Then they got up and chose to sit as far away from us as possible.
This above the fact you were German might have been the insult to them. It's something I've noticed that many people take offense when people speak a foreign language around them in their home country. I see it a lot when people speak Spanish (or Mexican if you prefer since it is different enough) and it's almost a slap to the face of people around you.
The perception being you moved/are in another country and aren't taking the effort to assimilate to it or are saying something to purposely exclude those around you. Usually it's because those people feel you're talking about them whether you are or not.
Of course it's also possible they really didn't like the fact you were German either. I don't know what the British mentality to Germans is but I'm sure there's still some who hold lingering resentment from WWII.
Just look at any other country where there was a past oppression or conflict and you'll find people do not like to associate with the former enemy, no matter how many decades have past or whether they were even alive at the time. It's inherited from their parents and from their parents on back to whenever it originated. People bring up their children to distrust others based on nationality or ethnicity.