Nature, and evolution, don't follow motive based logic. Random mutations that are temporarily beneficial but are detrimental to the long term do happen.
To put it another way, a cell mutates based off of random chance. It doesn't have desires. We only have to go back as far as 1918 to see an example of a virus that could not have been engineered and was highly transmissible and highly deadly. As you say, in the long term that doesn't work out- the virus in that case mutated to be much more mild- which is why you won't see viruses like that surviving for long. But it still doesn't make sense to assume viruses evolve according to a motivation based logic.
To put it another way, a cell mutates based off of random chance. It doesn't have desires. We only have to go back as far as 1918 to see an example of a virus that could not have been engineered and was highly transmissible and highly deadly. As you say, in the long term that doesn't work out- the virus in that case mutated to be much more mild- which is why you won't see viruses like that surviving for long. But it still doesn't make sense to assume viruses evolve according to a motivation based logic.