The unusual structure of this proverb may make it difficult to understand. It becomes easier if we change the structure to "He who teaches all teaches ill." The word "ill" here means "badly". So it means that the teacher who teaches students everything, does not teach well. A good teacher lets students discover some things for themselves.
If you eat with the devil, you need a (very) long spoon so that you can keep your distance. If you mix with bad people, you should be careful not to be influenced by them. A warning not to get too close when dealing with evil people.