When someone is referred to as a bad egg, it means that he or she has turned out to be bad, despite early signs of being a decent person. Terms like “bad apple” and “bad seed” are also used in the same way. The term often comes with an implication that the individual in question does not have a chance at redemption; like a rotten egg, he or she is simply bad to the core.
People have been referring to each other as “eggs” since the 1600s, and the origins of the use of “egg” in slang are a bit unclear. It may be a reference to the classical egg-shape of the human head. The sense of a “bad egg” emerged in the mid-1800s, first appearing in a newspaper opinion column about a corrupt mayor. The column pointed out that he had numerous links to the underworld, despite seeming like an ordinary fellow, and righteous citizens should not vote for him in the upcoming election.
Just like a literal bad egg, a human one typically has a perfectly ordinary surface which does not provide any hints as to what's inside. When eggs go bad, their shells typically remain intact for some time, and the truth of the matter is only revealed when the shell is cracked open to reveal the spoiled interior of the egg. In the case of a human bad egg, people may not realize that he or she is bad until matters have come to a head.
The term is also linked with a certain amount of dishonesty. A bad egg obviously would need to lie to conceal his or her bad identity, preserving an innocent and wholesome appearance. When the person is exposed, many people wonder when he or she was telling the truth, and when lies were told. This dishonesty can also be disheartening for people for supported him or her in some way, as they typically feel betrayed and used.
Some people talk about “bad eggs” in the sense of people who are obviously bad, or people who might be a bad influence. For example, a parent might tell a child not to associate with so-and-so, because he or she is a “bad egg.” In this case, the truth about the bad egg's nature is out, but he or she could still be a harmful influence on people who are impressionable, such as children.