As far as I know, it's primarily a matter of policy. Gun use is the ultima ratio, only to be used when other means are insufficient. Constitutionally, this is a reflection of the principle of proportionality [1] in conjunction with article 1 and 2 of the German constitution. This means that police officers are required by law to use the least intrusive means available to stop a crime and not use disproportionate means (obviously, with due regard to the difficulty involved when making split-second decisions or judgements based on incomplete and insufficient information).
On a practical level, this is ensured by two mechanisms. Firstly, these principles are part of the firearms training for police officers. Secondly, each gun use by a police officer in the course of his or her duty automatically triggers a criminal investigation (even if it is obvious self-defense). This adds a high inconvenience factor even for justified uses that discourages casual shooting. (In 1993, allegations that a GSG-9 member had executed the terrorist Wolfgang Grams [2] nearly led to the dissolution of the GSG-9 and, along with the botched execution of the raid, caused the resignation of the Minister of the Interior.)