This detainment of the 104th recruits began during the last few seconds in the last episode of Season 1, right after the dusts settles
after the battle between Eren and Annie
Season 1, Ep 25
As Annie is being kept deep underground, a group of the former 104th Cadet Corps soldiers are nearing an unknown location, not knowing of the dangers awaiting them.
In this scene, they are also wearing regular civilian clothing and no ODM gear. And as we see, they are being held in the beginning of Season 2 due potential of titan spies
Season 2, Ep 1
12 hours before this, the 104th recruits are kept at a southern outpost in Wall Rose under suspicions of a Titan spy among them
Prior to the titan attack in season 1, the idea of Titan Shifters was unknown to a majority of the population; very few actually knew about them. At the end of season 1, both of the (currently) revealed Titan Shifters were from the 104th recruits. As Henjin and Nevious stated in the comments, a lot of the 104th cadets were refugees from the initial titan attack and there was little known of their history.
In Season 2, Ep 6, which occurs only three days later (according to the timeline), it shows that
Eren thinks back to twelve hours earlier at Ehrmich District where Sasha's report revealed that Reiner and Bertholdt were registered as originating from the same region as Annie Leonhart.
So based on this information, the 104th cadet contained 2 confirmed and 2 suspected Titan Shifters. Given that 2 others came from the same region as one of the Titan Shifters, and with no knowledge of how many Titan Shiters there could be, it was better to isolate them then draw attention to specific individuals.