Civil law or not, courts still have (and need) the power to "legislate the gaps" (and similarly, statutes override case law even in common law countries). That has always been the case.
The problem is that there are genuine inventions that do involve software, such as computer-controlled anti-lock braking systems. This has led to the widely accepted doctrine of only "computer programs as such" being exempted from patentability; what is being disputed is what "as such" means and when a software-based invention is more than just a computer program.
As to the relevant statutes, the wording of section 1 of the German patent law (in agreement with article 52 of the European Patent Convention, which exempts "programs for computers") is that "programs for data processing devices" are not patentable, and the more recent BGH decisions really stretch the interpretation of the law to the breaking point of plausibility.