I knew one horse who did this literally her whole life. We all thought it was just something she did since we tried everything, but she recently had to be put down because she had a tumor in one ear that even the vet didn't find until it was too late. Generally, head tossing can also be a sign of an ear infection or ear pain, so I suggest getting his ears checked as well.
He is most likely just reluctant to push forward to contact. Keep your completely hands still in this case, and apply more leg. It could also be good to get his back checked for stiffness and ask your vet about head shaking syndrome.