Why have parasites not evolved to be harmless?
There are actually many examples of viruses that have integrated into the human genome and were rendered harmless, perhaps even helpful. 

This New Scientist article referencing this Nature article describes endogenous retroviruses, which are ancient viruses which have integrated into the human genome. 


  About 9 per cent of our genome is thought to have come about this way.
  Until recently, these viral relics were largely dismissed as inactive
  “junk” that ceased to have any impact on their host many thousands of
  years ago. The discovery that HERVK, the most recent ERV to make
  itself at home in our DNA – probably around 200,000 years ago – is
  active in human embryos challenges that notion.
  
  Joanna Wysocka and her colleagues at Stanford University in California
  made the unexpected find while they were analysing gene activity in
  3-day-old human embryos, which are bundles of eight cells. Besides DNA
  from the parents, they found genetic material from HERVK. “The cells
  were full of viral protein products, some of which had assembled to
  form viral-like particles,” says Wysocka.
  
  Further experiments revealed that the virus appears to produce a
  protein that prevents other viruses penetrating the embryo, suggesting
  it protects the embryo from dangerous circulating viruses, such as
  influenza. It also seems to play a crucial role in the genetic
  activity of the embryonic cells, helping to genetic instructions to
  the cellular protein factories.


Additionally, the endosymbiotic theory is also another possible example. It is thought that mitochondria and chloroplasts are previously free-living, possibly parasitic organisms that ended up integrating into the host cell and living as an organelle. 

In short, parasites absolutely can and do evolve into harmless versions of themselves. There are already discovered examples, and as the human genome is better understood, doubtlessly more would be discovered.