It can be a sign of stress, get his back and teeth checked and tack, but apart from that theres nothing you can do really. My mare does it when im asking her to do more difficult movements.
As PG says, teeth grinding is a stress issue. The only way you could eliminate it is remove the cause - perhaps you're getting short-tempered when he doesn't do as you ask? Or tensing up? Try breaking down the movement a little more, to make it easier for him. It may work, or it may not. My pony has always been a tooth grinder in stressful situations (it really made me cringe during farrier visits!), but his teeth are still in good nick!
Hi there, Im new to all this so hope I do it right! Just had to reply to your post though coz our boy has been on box rest for just over a month now and sometimes when u go to touch him he grinds his teeth as if he doesnt want u near him
but also when you find his "itchy" spot on his back he also grinds him teeth like hes enjoying it and puts his ears forward....so realy not sure if its a good or bad thing...