Yes, the secretive trial of detainees is justified in order to protect intelligence sources, because intelligence sources are very helpful in preventing future attacks. Intelligence sources are critical and have even been successful in preventing future attacks. Because they have committed acts of war, it is fair they are tried in secret.
Establishing and maintaining human intelligence sources is reportedly one of the most difficult things for intelligence agents to do. The intelligence these sources provide is sometimes critical to military operations and national security efforts. For these reasons, secret trials for detainees are acceptable. However, because of the suspect nature of anything governments do in secret, it is crucial that operatives maintain impeccable records of detaining and trying prisoners, and it must be verifiable after the fact. The standard of treatment in such proceedings must be beyond reproach. If these criteria cannot be met, then the prisoners must be tried in public courts.