What kind of whip do you use? I suggest a lean and mean dressage whip or a lunge whip that is thin enough to make sharp noises. Don't let them even get to the point where they are all crowding by the gates - use the whip before that, as you are approaching the gates with your horse, walk with confidence and keep a LARGE personal space around you. When anyone enters it, MEAN it when you use the whip to send them out of your space. You don't need to hit them senselessly, just a quick, sharp touch to get the message across, and swinging it around you to reinforce the size of your personal space. Pretend you are a mare and the gate is your foal you need to guard, and try to act with the consequency and the strong opinion of such mare. ;)
I have come a long way, to surrender my shadow to the shadow of my horse.