I breed a scraggy and an emboar and come back to an egg???
As long as the Scraggy and Emboar were of different genders, this was no glitch. This is due to both being in the same Egg Group. All Pokemon belong to one or two Egg Groups, and any Pokemon can breed with any other Pokemon in the same Egg Group (with the exceptions of Pokemon certain Egg Groups). So don't worry, it was no glitch. Source: http://pokemondb.net/mechanics/egg-groups/field http://pokemondb.net/mechanics/breeding
When you breed any two Pokemon together, you get an egg. That egg will eventually hatch, and in it will be the lowest evolutionary form of the mother Pokemon.
Hope I helped!