Pathogens don't evolve to be harmless to their hosts, because that doesn't benefit the pathogen.
For example, think about a pathogen, like cholera, that spreads by fecal/oral contamination. How could it enhance its transmission? One obvious way is by increasing the amount of fecal contamination, which means causing diarrhea, which means harming the host.
Or think about a pathogen, like myxomavirus, that spreads via sand fleas. The fleas bite one rabbit, jump to a new one, and infect it. How could the virus enhance its transmission? It turns out that sand fleas don't bite dead rabbits, so viruses that kill their hosts immediately lose out. But on the other hand, perfectly healthy rabbits groom away the fleas, and those viruses lose out. The viruses that transmitted best made their hosts very, very sick, too sick to groom, for a long time, to maximize transmission.
Or think about a pathogen that's transmitted through saliva, like rabies. Maximizing the number of new hosts that get bitten, by damaging the brain, would help there.
There are generally balances for maximizing transmission. Sexually-transmitted pathogens might not make the host sick for a longer time. Respiratory agents might do better with hosts that can mingle more with potential new hosts, while fecal contamination doesn't need such a healthy host. But in general, pathogens evolve toward maximizing transmission, not host health.
(You may wonder why pathogens don't change their mode of transmission - why don't fecal transmitters evolve the ability to spread by respiratory transmission? The answer is generally the same as any other "Why doesn't X evolve Y?" questions -- because the path toward a new complex ability means going through a phase where the pathogen is not as good at either ability, and gets out-competed by its more traditional relatives.)