I think it’s more sinister than that. If you look at how she wormed her way into Petraeus deepest personal life, this was more than a book writing mission. Sounds like a classic ‘honey trap’ operation to me. Question is, WHO was paying her; possibly FOREIGN source to get information? Note how hot and heavy the FBI is raiding her house. This is more than a fling thing.
If she really fancied herself as a great or evolving writer, she MAY have just stockpiled the secrets to use in future books. That is a naive, but possible, explanation. But that is giving her much benefit of the doubt, and I tend to agree with you that there is likely a more sinister motive/explanation here.