One reason is the German historical responsibility towards Jews, which plays important role in German-Israeli relations.
Another reason (as already pointed in the other answers) is that in this way Germany is essentially subsidizing its own industry from the government budget - it is a kind of inexplicit economic stimulus. Note that this is not unlike the American financial aid to Israel, which is generally supposed to be used for buying American-made weapons.
In other words, it is good for German public relations and good for German economy.
Update
I was asked in the comments to expand about German historical responsibility towards Jewish people and how this affects the relationships with Israel.
The planned genocide of Jewish people committed by Nazi Germany was an unprecedented crime - not only in terms of numbers, but also because it was widely publicized, affecting German international standing as a country and as a nation. Moreover, the gravity of these events is widely recognized by Germans themselves. This resulted in German efforts to rehabilitate their nation, which have been moving along several tracks:
- Reparations to survivors and their families, as well as restoration of property and citizenship rights (e.g., children and grandchildren of holocaust survivors or those who were forced to flee Germany in Nazi era have right to German citizenship.)
- Fostering relationships between two peoples - e.g., via academic exchanges and joint research projects.
- Commitment to survival and economic well-being of Jewish people. In this respect Israel plays a special role, not only as a home to many holocaust survivors, but also as the state whose mission is protecting Jewish people and anyone affected by antisemitism. Supplying military systems to Israel, as well as the extended economic cooperation serve these goals.
These realities have been recognized and restated by many German governments, and notably by those led by Angela Merkel, who visited Israel on many occasions, among other things addressing the Knesset and leading joint German-Israeli cabinet meetings.
Update 13/07/2022
As an example one could cite the message by Steffen Siebert, the newly appointed German ambassador to Israel:
In the two-minute video, Seibert spoke in Hebrew and English. He said that Germany and Israel today shared a special friendship after the “monstrous crimes of the Shoah”. “We have learned the lessons of our history,” Seibert asserted. “One of the most important lessons is to stand by the State of Israel and be committed to its security.”