In my personal experience basically all spam calls in France come from a fixed set of number prefixes. [0]
So phone companies could just offer to block those prefixes - it would be a trivial solution to the problem. But it's not an option [1], so either they make good money from those calls, or there's some other hurdle or legal issue.
Either way the new law could (in addition to making it illegal for companies to make spam calls) also simply have mandated that network operators block the known ones. Too bad.
[0] https://lemagdelaconso.ouest-france.fr/dossier-2418-demarcha...
[1] https://communaute.orange.fr/t5/mon-telephone-par-internet-e...