A federal judge ruled the Defense Department in contempt of court for not videotaping the testimony of a Guantánamo Bay detainee.