Why (and how) would it exterminate bacteria according to you?
(People tend to forget that most lifeforms on our planets are bacteria, which live from the depths of the sea to the clouds themselves).
Why? Because they're annoying.
We're trying. A good chunk of medicine and medical research is about dealing with annoyance of bacteria and other microorganisms, and figuring out how to get rid of them locally or globally (vaccination's end-game is eradication of pathogens, and we've only succeeded with one so far, and that was a virus).
Of course, some bacteria are useful for us (directly or indirectly), which makes the eradication efforts much more difficult, as we need to be thoughtful about it. For silicon-based life, they're probably all going to be pure annoyance.
“But humans cause extinctions” is not a strong argument.
If they inherit their morals from ours and believe themselves to be full and worthy successors, it shouldn't be too difficult a leap to clean things up.
Obviously we're just repeating in simple terms a conversation that has been had for years now at length in other places, but I think the conclusion is we just don't quite know what will happen.
AI won't need to eliminate humanity over resources. The global human population will contract to sub three billion people rapidly. Easily fully sustainable right now and with even more advanced technology it will be a trivial matter (ie continued improvements in solar, wind, nuclear, storage).
It's far more likely that in the near term, 50-100 years, AI will largely view humans as a non-threatening curiosity co-habitant on this planet. There will be occasional AI v human conflicts, which will be mediated in part by more neutral agreeable AI, and there will be AI defenders involved helping protect the humans (pro human AI).
The anti-human humans will drive the development of the anti-human AI. There is an ethos that isn't uncommon: humans that despise humans; 'I love animals, I hate people' - they'll train AI to dislike & distrust humans in their ideological image.
How does this follow logically?
We go from [tiny fraction of humans can do a thing with limited practical relevance] to [AI can do it even better, those few humans aren't the cutting edge anymore] and then... extinction of all humans? You've left too many steps as an exercise to the reader.