Enemies get to say which one of you they want to attack. Usually the mount is easier to hit, but killing it doesn't stop the rider from attacking on foot. Attacking the rider is harder, but more effective if successful (especially if the mount decides not to fight on its own).
The monster is making a tactically sound decision by attacking you, since you are more dangerous and squishier. With the mount, he would have to carve through the mount's HP, and still have to deal with your high DPS after. Also when your HP is low, you might retreat, but if the mount's HP is low at best you'll send the mount away and keep fighting yourself. What you can do is use armor and other means to make your AC higher (even if it reduces your own DPS) while trying to maximize your mount's DPS and neglecting its AC. That way, either enemies stop targeting you like you want, or they still target you but you derive greater tactical advantage. Either way you win.
Your DM could have monsters acquire targets randomly, or have them target based on roleplaying or flavor reasons (eg maybe these orcs just really hate halflings), and not tactics. However, he doesn't have to. Some DMs like to have monsters always act in a tactically optimal way - if you don't like it, you might want to talk to the DM about it and clarify whether combats are supposed to be roleplaying focused, or tactics focused.
Realistically, if one tries to attack the rider and misses, there should be a chance to hit the mount instead. However I don't believe 5e DnD models this by default. Part of the problem is that in DnD, there's no missing - there's only failing to do damage which does not necessarily mean missing: it can mean hitting but being repelled by the armor. Granted, you can also beat the AC but still fail to do damage because of damage resistance on the armor... Best not think too hard on it, but the point is that failing to beat the AC doesn't automatically mean miss.
The exceptions to this are:
- If something moves the mount (like a spell) you must pass a DC 10 Dex save or you will fall off the mount.
- If they knock it prone, you'll have to burn an action on dismounting or be knocked prone.
- If the mount provokes an attack of opportunity, they can use it to attack you instead of the mount.
These aren't really exceptions though, and more to do with special effects. There isn't anything that lets you attack both rider and mount at once (except for area effect spells) or forces you to attack one or the other.