In one way, the expression "bad apple" means something that needs to be removed before it can corrupt the rest of the group. A discontent employee who constantly criticizes the manager may have to be fired or reassigned so the rest of the team won't be negatively influenced by his or her bad attitude. Removing the "bad apple" is usually a good idea.
On the other hand, a "bad apple" is something that shouldn't be viewed as a representation of the entire group. When a police officer gets caught accepting a bribe or a minister gets caught committing adultery, that doesn't mean all members of those organizations are just as corrupt. One bad apple doesn't have to spoil the entire bunch.