A slot is an asset, and you'd already spent cash to get it.
You closed the route, and gave up the slot.
Therefore, your airline's assets decreased.
You DIDN'T lose any actual cash, you didn't pay any penalty. But because you did lose the asset, you're allowed to record that as a loss in order to pay less tax at the end of the year.
It's functionally no different to earning 55k for the year IRL, donating 5k to a recognised charity, and therefore only paying tax for 50k of income.