If the bank’s actions were illegal, then the matter would be being pursued by criminal charges rather than by lawsuit.
Legal or not, Capitol One’s actions were likely not instigated on their own. My bet is that there was pressure from some government agency being placed on them to do this. If this law suit causes Capitol One to reveal any such coercion, that alone would make it worthwhile.