Let's look at some examples. Good grades are good, but cheating is evil. Don't imitate the cheating. The allowance might be good, but the disrespect for parents is evil. Don't imitate and be disrespectful toward your parents.
Intelligence is usually good, but being nasty to others is evil.
Don't imitate and treat others badly. Those are just a few examples of how we must be careful not to imitate evil actions, even though they might accompany good things. The Bible contains accounts of people who did good things, even though they weren't perfect. We can imitate the good things they did, including being faithful to God, praying, sharing, and caring. The best One to imitate, though, is Jesus.