Ending explained , perhaps
I don’t think that Gene Hackman broke down from the interrogation and confessed. I think that knowing that he didn’t do it but knowing that in his darkroom there were pictures he had developed of both victims then he mistakenly led himself to believe that his wife found the pictures and he believed that because she was so jealous she murdered the children . A mention was made early in the movie by Hackman that she was a green monster of jealousy. He confesses because realizing this and out of the true love for his wife he would protect her by confessing to the murders he thought she committed. The looks Hackman gave her through the one way glass confirm this and her looks at him would also lead you to think that she was realizing that he was sacrificing himself for her and how much he really loved her, until she spit at the glass. That’s when he the final twist is revealed that they just caught the real killer.
Further reinforcing this is when she goes to him at the very end, she understands that he was sacrificing himself for her and how deeply he loves her, that she was wrong about the episode with her niece . She realizes that the obvious conclusion he would have come to was that he thought that she killed the children out of jealousy. Shes ready to hug, apologize but he is through with her now that his dark secrets are exposed.