These are the quotes for gen 3 gen 4 and gen 5 respectively:
The Generation III games are the only games to actually make use of the term "Bad EGG". The string is used to identify Eggs that appear to have been corrupted. The Trainer Memo section of such Eggs' summaries invariably states that they are "A peculiar egg obtained in a trade." Such Eggs do not actually hatch unless prompted to with a cheat device. The bad egg can also be found while cheating at some parts.
In Generation IV, bad eggs are sometimes found by using cheats to capture your opponent's Pokémon. Bad Eggs also occur when the player uses a cheat device to catch Pokémon in the wild that are not found in the game, like Regice in Pokémon Pearl, or Mesprit in Pokémon Soul Silver. A perfectly normal Pokémon in the PC will be identified as 'Bad Egg'. The elite four in Ruby ,Emerald, Sapphire, Leaf Green, and Fire Red all have at least one bad egg in their party, so while utilizing a cheat to capture their Pokémon, make sure to save first. The Bad Egg will also dry out your battery so watch out! Also after this occurs clock based events will not work
In generation V, most glitches have been fixed for bad eggs. In other words, if you recieve one, your game will not freeze or corrupt, but that also means you can't get rid of them with the current resources, unless you hack into the game using a device of some sort. In further detail, the egg cannot be used in a battle or be released. It acts like a normal egg that never hatches. If you manage to get one that does hatch, it will act like an ordinary one and freeze the game.
Overall its better off you do not get the egg and do not hatch it.