Assuming you dump the sludge in the bin when you clean the filter then it’s much better than going into the ocean.
Depending on your location, they’ll either get destroyed by incineration or put in landfill where they’ll do less harm and hopefully break down after a few centuries.
Of course, if you clean the filter by flushing the sludge down the sink then you didn’t solve anything.