After My LV5 Tepig in Black gains thousands exp from EXP Share, it keeps level-up leveling-up to LV21 without evolving. Why?
Are you saying that it doesn't evolve until it hits level 21? That's normal for a Pokemon gaining so many levels.
If a Pokemon gains more levels than required for it to evolve (e.g. Tepid evolves into Pignite at level 17) after one battle, then it will level up all of its experience before it evolves.
To put this in simple terms. Lower the level of a given Pokemon, the higher the exp gain. You must have defeated a high leveled Pokemon, a Pokemon from Cynthia or from an athlete in one of the courts in Nimbassa, in order for this to happen.
Don't worry this is happens a lot when training weak(er) Pokemon. I know this from experience.