It’s the root of an evil not all evil.
Its the love of money. The lusting after wealth, instead of loving God and putting Him first, that is the root of evil. Money and wealth are not sinful in the aggregate. But idolatry is a horrible sin, with horrible consequences.