Think about trying to spear a large dog while it's yanking you around. You'd be just as likely to stab yourself as the dog.
Because you have limited arrows, and it's hard to hit targets that are trying to avoid being hit? Because the typical encounter distance in a dungeon is 20 feet, AKA charging range?
Anything other than "disadvantage on the attack roll if you are within 5 feet of a hostile creature" would be great. Under this rule, you have trouble shooting enemies just because an angry hamster is gnawing on your boot.