the transaction will only be written on the blockchain as soon as a payment channel is closed. So would miners still get a fee when a channel is closed right?
Yes.
Also, I understand that you pay a fee to open a channel and then fund it. Is that fee going to the miners as well
Yes, to the miners.
Finally, if the fees get to low (because they are only paid when a channel closes, or something like that), and there is no block reward, because there are no more bitcoins to mine, what would be the incentive to support the network? Would miners keep verifying transactions and at the same time would try to run LN nodes with big limits so that a lot of payments would pass their node? (assuming they get small fees when a payment passes their nodes, which I believe they do).
Indeed, no incentive to run the blockchain itself would exist, but only if Lightning (or some other 2nd layer tech) had developed to the point where using the on-chain network wasn't needed for anything.
And if the on-chain network wasn't needed for anything, there's no need to mine blocks so that transactions can be sent. Everyone would keep a copy of the final state of the blockchain to ensure people were sending valid BTC over Lightning/2nd-layer-of-the-future. Or maybe there would be a way of avoiding that, bear in mind that we're talking about the year 2140, when it's more likely than not that we'll all be dead, and vast improvements in computer science and cryptography are likely to have taken place.