Why do German universities rank so low internationally?
There are lots of biases in international academic rankings, they tend to favour US and UK universities because they use criteria which are mostly relevant for a market-oriented academic system, such as the US/UK ones.
In many European countries the academic system is not market-oriented, or at least not as much as in the US and the UK: students fees are very low because higher education is mostly funded by public money.  Universities are seen as a public service offering education to society as a whole, rather than a kind of commercial institution which sells knowledge and qualifications to those who can afford it. As a consequence Non-US/UK universities are not as incentivized to attract international students, they don't make big efforts to play the competition game since their income doesn't depend (at least not much) on their international ranking.
Of course this is only a simplified explanation, but this is the main reason why US/UK universities perform better than German universities (among others) in international rankings.

[Edit] Originally this was only a quick answer to explain what (I think) is an important structural and cultural difference with respect to international rankings between UK/US-like academic systems and others. My point was only to emphasize this difference to the attention of prospective students looking at these rankings, knowing that this is a common source of misunderstanding among them. I didn't imagine that the question and my answer would attract so much attention. I gladly admit that this is a rather simplistic answer, and I'm happy to see that other answers have done a much better job than me at analyzing other aspects of the question in detail.