So now we have a German judge applying the Koran? Is this person a judicial idiot?
No, it´s what we call international private law. If there´s no connection to German law, the German court must apply the law of the country with the most connections - in this case, Marocco. Strange, but helpful for foreigners who are unfamiliar with the local law.