Martin Luther’s influence on J.S. Bach was profound; Bach’s library contained two expensive collected editions of Luther’s writings, which exerted demonstrable impact on his works—not least on the third Clavierübung.
Scholars have long puzzled over the dramatic changes that Bach introduced at the work’s engraving stage. These changes largely involved the addition rather than the removal of material, and the only explanation for wishing to enlarge the collection—a decision that caused enormous problems with the scheduled production and publication dates—must be the way in which Bach viewed his success in having fulfilled the overall objective: providing musical items reflecting Luther’s catechism.
It is easy for such a scheme to follow the letter of the law through settings of the Ten Commandments, the Creed, and the Sacraments, but not so easy for it to capture the spirit. Luther’s doctrine stands apart by virtue of its clear insistence that the law must embody a human experience “from the heart”. All such experience, whether painful or pleasurable, requires this essential attribute. Through their clear spiritual resonances, the new movements provided a fitting frame for a collection of music inspired by Luther’s teachings.
This according to “J.S. Bach’s prelude and fugue in E flat (BWV 552, 1/2): An inspiration of the heart?” by Roger Wibberley (Music theory online IV/5 [September 1998]).