We don't have any idea what the police might be thinking at this point. Maybe they got a tip that the fire was arson. In which case, it would make sense to detain anyone inside the library, especially if they try to run. What they can prove would be relevant. It also wouldn't be the first time the cops ever made an unjustified arrest even if they didn't have any other reason than 'they're insane criminals, must be their fault.'