1.At first,we should define what is "善人” and "不善人“.
A person who has good personal qualities could be "善人“;on the contrary is "不善人”. (So in this situation, "善人“means a person who is kind or nice.)
Or a person who is the authority in a field; on the contrary is "不善人”(In this condition, "善人”means a person who is very good at doing something.)
There are two kinds of definition on internet about "善人“;but in my opinion, both of them are make sense.
2."师“ means: teacher, standard, example, imitator
3."资” means: reference material
Apparently, this sentence means" Good people could be the teacher of bad people, and bad people could provide reference material to good people."
Extended meaning: " Good people could show bad people what is good, and bad people could correct themselves from what they learn or see on good people; Bad people would show to good people which is bad, so good people could warn themselves do not do that or avoid doing that."
Of course, we can not just say "good" people and "bad" people in this condition, actually there is no absolute "good" or "bad" person in the world. But i don't know how to express them accurately.