Federal law allows judges to order witnesses to be detained if the government can prove that their testimony has extraordinary value for a criminal case and that they would be a flight risk and unlikely to respond to a subpoena.
Marzieh Hashemi, of Iran's "Press TV," was no flight risk. If asked to testify, she would have asked questions but would likely have done it without much fanfare. As it is, she was treated very shabbily. It doesn't bode well for how Americans in other countries should expect to be treated.
I don't agree with her religion or with the Iranian government's Islamic theocracy, but I've watched her for perhaps hundreds of hours all told and she only ever impressed me as someone interested in treating others decently regardless of race, ethnicity, religion, etc.
I have no doubt whatsoever that right-wing Zionists/neocons are behind her mistreatment.