It's only "no longer any security threat" because he got caught. The punishment is to dissuade anyone else from having an affair, which a foreign government could use to make their lives difficult by telling their spouse.
Too little, too late.
http://www.washingtonpost.com/politics/federal_government/ho...
> That agent’s role in the case consisted simply of passing along information from Kelley to the FBI agents who conducted the investigation, but that agent was subsequently told by his superiors to steer clear of the case because they grew concerned that the agent had become obsessed with the investigation, the official said. The agent was a friend of Kelley and long before the case involving Petraeus got under way, the agent had sent Kelley shirtless photos of himself, according to this official.
Still, in my view, and I think in the view of many others, "flag" officers never really retire. And as such his behavior in this matter brings disgrace to the service and uniform. For me, it is just another recent example that really calls into question the ethics of an entire generation of our military. Patraeus, Ward, Sinclair, Allen, McChrystal, the list goes on and on.