^First off, evolution didn't "intend" anything. That's why I put it in quotes. It's not a conscious force, it's a statistical process in which stochastically emerging traits that happen to increase reproductive success in a given environment are therefore reproduced more successfully.
Second, the point is that wherever a potential comes from, it's possible to repurpose it in other ways. Louis Zimmerman gave his EMHs artificial intelligence capable of learning so that they could be better medical programs. He never intended them to be left active long enough to repurpose that learning capacity for non-medical purposes; indeed, we specifically saw in "The Swarm" and "Life Line" that he considered that a misuse of the technology, something that it wasn't designed to sustain and that threatened to destabilize it.