Him being removed for sleeping with a spy would not necessarily be intended as a punishment for sleeping with her, it's a self defense mechanism to prevent the spy from continuing to have access to a highly placed, compromised individual