bacteria mostly need to be replicating to spread mutations as well.
There are mechanisms for bacteria to uptake dna in the environment and incorporate it (e.g. antibiotic resistance). But without replication of the bacteria the resistance wont spread.
One interesting point is that in general biology they teach that lamarckian evolution doesnt exist, but bacterial uptake of DNA demonstrates that it does exist.