That wasn't something Jesus said, it's from 1 Timothy, which is a pastoral attributed to Paul of Tarsus though probably not written by Authentic Paul. The koine used a word that would be better translated as "many different kinds" rather than "all kinds"; in other words the writer was saying that love of money was the root of much, but not all, evil.