I think bad eggs only form when you leave a regular egg in the pc for more than 2 weeks. I had one of those before, it was the result of a unsuccessful AR code. But it had Pokerus, so it was kinda good in a way....
Oh, and maybe it is a glitch.. Oh yeah, if you look on the user submitted cheats section for Pokemon Emerald it has a 'Bad Egg Removal Cheat'. Might want to look at that.