(“. . . he feels rightly offended.”)
There are multiple reasons why a horse might kick out at his rider’s leg. The first cause may be related to pain or discomfort. Ulcers in his hind gut would be a for instance. Before you go blaming him, you need to be sure there’s not an easy solution through veterinary assistance.
A fairly harmless but occasional cause is simple exuberance. Actively kicking out isn’t the same thing as bouncing his hind end up into the air. While you don’t want him to do that, it’s much less critical than if he is actively trying to buck you off! Lunge him a little while to get the bounces out, and you may have no further problem.
Then we come to training-related situations. Your leg aid may simply be too strong, and especially if he doesn’t understand it, you can get that sort of reaction. Go back to simple work in the walk or even from the ground teaching him to yield from pressure and respect what your leg is telling him. Then apply it mounted, then in motion, then at faster gaits. Be aware that the placement of your leg can be an issue. Put your outside spur too far back at what he perceives as his “private space “and he may be offended enough to kick at the leg. Be sure your horse is understanding what the leg means before you just try to amplify it!
Then there are also the occasions when the horse is spoiled from his earlier (non) training and is disinterested or thoroughly unimpressed with your aids. Using aids which are routinely too small to get a response can persuade him that no response is ever required, and when you ask more he feels rightfully offended. Sometimes you simply need to escalate and ride through his complaints and out the other side, ignoring his antics and showing him that regardless of his opinion on the matter, the work you were demanding simply must happen. With persistence the horse will usually decide it’s not worth the trouble to complain, especially when the correct response results in smaller aids and follow up rewards.