What Petraeus did was also wrong, and he should not be immune from punishment for it. A question, though, is whether he has perhaps already been punished enough?
Despite the fact that he did break the law (or violate regulations, which is effectively the same), I would say it's not in the same class as what Hillary did. Petraeus allowed one person -- who was a military officer and who almost certainly had at least a SECRET, if not TOP SECRET, clearance (but, admittedly, not a need to know) -- to see physical books. Unless the books, which nobody knew she had, were physically stolen from her, they were not exposed to foreign agents.
Hillary, on the other hand, placed unknown numbers of highly classified documents on an unsecured, uncontrolled server, passing them to said unsecured server through unsecured data paths, often passing them through aids who may or may not have had security clearances but who certainly did not have a need to know and thus should not have had any access to said documents, thereby exposing the classified information to numerous foreign entities over an extended period of time.
Which had the potential for greater harm?