Those scenarios fall under the "as far as possible and practical" clause. Plants and fungi need insects to pollinate them, and microorganisms for nutrients. Veganism isn't a death-cult, so we have to eat something. Therefore, those insects and microorganisms are necessary.
Ditto for immune system and hand sanitizer. They are necessary parts of being human.
Another common one to ask about is animals killed in the process of farming, such as field mice that are caught in machinery. I also recognize those as necessary in the current system, but I do grow some of my own food as a small way to minimize those things, and I believe that if more people cared, we could eliminate that problem. But it's not something in my power, so I must classify it under the "as far as possible and practical" clause.
Another is animals that die as a result of roads. My answer to that one is /c/fuckcars
You could look at logrotate if you don't want to do something custom