Ned was crazy, but he still had a Heart!
It clearly showed you in the end scene where Ned's is willing to go to prison for Rachel even when she killed the guy who molested her. Rachel had no clue why Ned wanted to stay behind because she was crazy herself, but Ned knew and consoled her to go and be with her daughter because he cared for her happiness!