There's "could" and then there is "would." Why would a potential terrorist want to use fentanyl versus another type of chemical agent? Many police and most EMS carry doses of naloxone. While a mass casualty scenario would be a nightmare no matter what especially if multiple doses were required per victim, there would still be some effective on-site treatment available. Seems like a more traditional chemical agent (nerve agents, blistering agents, choking agents, cyanides, etc) would likely be easier to obtain precursors for and even harder for emergency services to react to.
Perhaps because there is a Fentanyl/carfentanil smuggling pipeline to the US. And there isn't one for mustard gas, sarin, etc. Those you'd have to synthesize yourself.
The Fentanyl is compact, and potent. And it doesn't require much beyond basic plastic bagging to seal and transport it. No gas cylinders, no potentially volatile liquids etc.
The entry barrier to other chemical attacks is obtaining precursor chemicals, mixing/reacting them, and then capturing the end product in a way a terrorist can deploy. For strong synthetic narcotics, it's just money, figuring out a black market contact, then just opening/shaking the bag by a fan, or into an air duct, or contaminating surfaces the public would come into contact with.
Also, if people get tired, pass out quietly, instead of coughing, burning, blistering, screaming etc. it could generate a higher body count because it's less likely someone would flee or raise an alarm. Conversely, with it quiet, more victims might wander in.