Why the popularity of German? Second to English, German seems to be the most popular foreign language in anime. You see it in titles, names, and even quite a few characters are of German descent.

For example, many characters in Shingeki no Kyojin appear to be German/have German names and there are a lot of German references. Elfen Lied is also German (translates to "elf/elvish song").

Is there a reason for this?
Historically speaking, Germany and Japan have been on friendly terms since the 1930s (and even before), due to their shared militaristic ambitions just prior to the second world war (which led to their Axis Alliance). 


  After the Second World War, the economies of both nations experienced rapid recoveries; bilateral relations, now focused on economic issues, were soon re-established. Today, Japan and Germany are, respectively, the third and fourth largest economies in the world, and benefit greatly from many kinds of political, cultural, scientific and economic cooperation.


As a result, there is a lot of cross-cultural sharing, which is why you see a lot of German outside of just anime as well (for example, the Japanese word for part-time job (アルバイト) is based off the German word for work (arbeit).