Why does Helmer forgive Nora after reading the second letter?
The first letter is essentially a threat to expose Helmer and Nora publicly. Nora's fraudulent signature and her loan taken out from Krogstad will subject Nora to the punishment of law and will end Helmer's career. The second letter erases the threat, as Krogstad has changed his mind (thanks to Mrs. Linde).
In brief then, while he feels the threat to his own career, Helmer is extremely upset with Nora. When he finds that his career is no longer in danger, he forgives his wife.
Looking at the situation in more detail, Helmer's response to reading Krogstad's first letter is to condemn his wife and take on a tragic and accusing air.
"All these eight years -- she who was my joy and pride -- a hypocrite, a liar -- worse, worse -- a criminal!"
He feels that Nora has ruined him through her attempts to save him (Helmer) by taking out bond/loan from Krogstad. Helmer takes no heed of Nora's motives and expresses no acknowledgement of his own weakness, nor does he attempt to curb his accusations or show sympathy. Instead, he feels his professional doom keenly.
"Now you have destroyed all my happiness. You have ruined all my future."
Helmer says that he cannot trust the children with Nora any longer.
The second letter rescinds the threat against Nora and, by extension, against Helmer. Krogstad forgives Nora's loan, having been convinced by Mrs. Linde that he can find happiness and love with her (Mrs. Linde). Thus giving up his bitterness, Krogstad forgives the debt and Nora does not have to worry about being publicly exposed for her fraud.
At this point, Helmer calms down and feels he has been delivered from danger. Nora decides that she must leave and in announcing this, Helmer begs her to stay, arguing that the children need her. His about-face is remarkable. When he finally begins to understand Nora's plight, his empathy comes too late.
Even after he recognizes that in securing a loan Nora was acting to help Helmer, he fails to assign any idea of agency to her and instead puts her even more deeply into a passive role. He suggests that he will "serve as will and conscience both" to Nora because, he supposes, she is so weak as to become "both wife and child to him."
This pathetic vision of Nora is exactly what she ultimately refuses to accept.