This is the case because it believes you are right clicking on the horse. It will be the same with any entity, and I believe this is why you can't throw a spear at close range at another player, if you are within clicking distance. But I could be wrong.