Justine confesses because she is afraid of being damned to hell as a murderess. As a Catholic, it is important to be absolved of all sins before dying, and in order to do this, she had to admit to the sin...even though she did not commit it. There was enough vagueness in her account of things to put the guilt on her...obviously, she was fatigued from looking all night for William once she heard he was missing; this was on top of the harrowing journey she had just taken from her own mother's home. She was incoherent (for many reasons as the reader knows), and this fact, in addition to the presence of the locket in her pocket (placed there by the creature), has cast a very dark shade of guilt on her in the eyes of the villagers. Therefore, with all this weighing upon her, she is seemingly hopeless and helpless that anything but her death is in her near future. She confesses to be able to face her death without guilt. She does not consider that the telling of this lie will weight all the heavier upon her.