Thanks to Niantic handing out bans for Pokemon Go players who violate the Terms of Service in any way, you should already be wary of doing anything in-game beyond playing it safe and following the rules. So the fact that there's an egg glitch players are still exploiting in-game is confusing, especially when it could cause your game to become unplayable in a sense.
A recent exploit that's been going around allows players to take over gyms and slot in eggs instead of Pokemon in order to hold things down. Eggs can't be challenged or taken on for battles of supremacy, so anyone looking to take over a gym where an egg has been placed can't do so, which basically messes up the game as it is because it unbalances the game and keeps players from being able to change things out. Team members can also staff Pokemon with the eggs at the gym to get special defender rewards as well, which is that cheating Niantic has been warning you about.
If you end up doing this you may very well find yourself without a Pokemon Go account in the future, perma-banned by Niantic as retailiation for making a move to get rid of the pesky cheaters making the game more frustrating instead of fun for other players. While you're at it make sure you don't end up using a third-party app, either, because that could earn you a ban as well.
Pokemon Go is still at the heart of the Internet's popularity machine, with new scandals, news, crazy schemes and more popping up here and there across the internet, and most are harmless, but this whole placing an egg at a gym thing isn't harmless, it's just frustrating for other players looking to play the game right. You couldn't put an egg in the regular Pokemon games in a gym to battle a Gym Leader, could you? Same should go for Pokemon Go.