My thinking is yes. Here's why. Although cheating on your spouse is not a crime in the civilian world, if I'm correct it is illegal for US Military personnel. Petraeus is a career soldier and the relationship might have started when he was still in the Army.
Secondly, I saw something that suggested his girlfriend might have had unauthorized access to his computer. If you're running Central Command during war and you're Director of the CIA, your computer is classified. If she got on his computer even just to check her own email, he might have compromised US national security.
Thirdly, intelligence officers always have to be on guard against foreign spy agencies using romantic plants commonly called "honey traps" who lure them into relationships for the purpose of getting them to spill their guts on national security matters or blackmail them into handing over national security secrets. Staying on the job as the top CIA officer could send the wrong message to subordinates and water down the standards of not putting yourself in a compromising situation that could compromise American security.