Short anwer
Here, gesetzlich is not declined, because it is used as an adverb, not as an adjective.
Adjective
than the legal allowed cases → als den gesetzlichen zugelassenen Fällen
Here, the cases are allowed and legal. Therefore, both zugelassenen (allowed) and gesetzlichen (legal) are adjectives, which must be appropriately declined.
Adverb
than the legally allowed cases → als den gesetzlich zugelassenen Fällen
Here, however, the the cases are legally allowed. Therefore, gesetzlich (legally) is an adverb that modifies the adjective zugelassenen (allowed). German adverbs are not declined.