It is entirely possible that his teeth were hurting at one time when someone was checking his teeth. Probably his teething has something to do with it. He will remember the fact that it hurt when someone was touching his mouth.
What I would do to help him overcome this is to just lift the sides of the gums up, just enough to see the teeth, but not to see his bite. Only do it for a second or so. Praise him, but don't make too much of a fuss to start with. Treat him if he is food orientated. In time, when he is comfortable with this, you can move onto checking his bite. At this time I wouldn't let just anyone look, just yourself. Let him know that you are not going to hurt him. Once he is comfortable with you then you can start to let other people look.
I know a lot of people, and some judges, will only let the owner/handler touch the dogs mouth. Partly because of cross contamination of germs, and partly because you just don't know how the judge will treat the mouth. Some are a bit harsh. :-(