The disclosure of battle plans on a chat app created a new predicament for the defense secretary.