The bacteria is acting purposefully I guess in the same sense that a hammer acts purposefully to drive down a nail. I don't know if that's a correct usage of language or not but it's essentially the same thing. But it is correct to say the hammer's purpose is to drive down the nail, and the bacteria's purpose is to survive and reproduce successfully.
So what if a species goes extinct? That doesn't mean it can't evolve, only that it didn't adapt quickly enough.
So what if a species goes extinct? That doesn't mean it can't evolve, only that it didn't adapt quickly enough.