Valery Plame was not an active CIA operative at the time...
and had not been a covert operative for years. The law that prohibits revealing the identity of a covert operative has a time limit and she didn't fall within that constrain, so it wasn't a crime to reveal her name. If you read Libby's endictment, he wasn't charged with revealing Plame's name. Even the prosecuter determined that revealing her name wasn't a crime.
According to this, Joseph Wilson openly identified his wife's name in Who's Who from 1999 through 2005.
