King David implored G-d: "May my sin (i.e., the incident of Bathsheba) not be recorded in the Torah." Said G-d: "That is impossible. If the single letter 'yud' I removed from Sarai's name continuously protested for many years until Joshua came and I added it to his name... how much more so a complete section in Torah!"
Talmud, Sanhedrin 107a