It is quite ironic really. The procedural lapses that would have ensured Aseemanand's acquittal were identified by the Supreme Court while upholding the conviction of Dara Singh, a hardcore Hindu fanatic who had murdered Graham Stained, a Christian missionary. In that case, the Supreme Court laid down guidelines for such confessions before a magistrate.
If there is any chance that the police would have pressurized/tortured the accused, and the Magistrate fails to enquire and ascertain, the accused walks free. If there is a policeman present when the confession is being made before the Magistrate, the accused walks free. So it could be any lapse on the part of the Magistrate or the police, or both. I will only know once I get hold of the reported judgement.
However, since this is a terrorism case, we may assume that the court wouldn't have decided to disregard the confession lightly. There must have been a major screw up.
But such guidelines are required, because firstly we are dealing with a man's life and liberty, and secondly, if the Court starts upholding convictions even when procedural lapses are present, then the police/investigation agency/government can frame anyone and we are all unsafe.