Most likely, the letter was drafted by the woman’s lawyer, Petraeus agreed with its contents and signed it. Whether he should have done this is one thing, but its consumption of his time would have been minimal.
CIA Directors do have free time, just like everyone else. They go shopping, to movies, to sports events, etc. He might even golf.
It appears that Natalie now runs as a solo attorney according to a linked in Profile.
There might be a Holly factor in that letter. Even the best of friends do not know everything. The Petraeus family was only on Tampa about two years. Maybe they left with the illusion the Kelley family was as they appeared. It could have gone like this:
HP:
Dave, Jill called me today. Natalie’s ex is trying to get her son. She wants to know if you might write a letter for the court
DP:
What do they want me to say?
Further (and only speculating) what if that letter was the last nice thing DP did? What if further requests for any help were refused? Maybe a motive for revenge? Not saying that is what happened, only one avenue needing to be explored.
Such a scenario would not change the storyline. It would expose a trump card being held by another party.