Ahh... those horses that can't stand to be alone.
It's perfectly normal as horses are herd animals. But it's a right pain in the side.
The best thing to do is make it more work to be near the gate. Every time he tries to run towards it, tight circles and figure eights no bigger than 10 meters.
This is not really the same thing, but my horse once thought he could spook at a pair of deer running past the indoor. He spooked pretty badly and then refused to go in a corner. He'd do as you described.. bending away from it and running the opposite direction. Well I didn't like that so I made him do 10 meter circles in the opposite corner on the short side.. and slowly we'd creep closer to that corner just doing 10 meter circles (about 5) and then I'd let him go large and we'd cut across the arena and do it the other way.
He never spooked for deer or shied from that corner again.
The key is making their poor choices more work. Circles are hard, figure eights, serpentines, weaving, leg yields, shoulder in, haunches in, side passing.. lots of transitions. Anything that has him rethinking being by the entrance. Then all pressure goes away when he turns his nose from it or travels away from the gate. You make being from the gate pleasant. A nice stretchy trot or a walking break.
Another approach is to act like nothing has changed. Just serpentine from one end to the other, then do figure eights so you aren't really ever by the gate and only let him have walk breaks when he's coming past the gate (in a dressage arena, that would be letter M going to the left, and H going right)
And a third approach, if you have a friend that rides with you, ask them to leave and enter the arena multiple times and be gone for extended periods of time. And just continue on with your workout. Eventually the horse won't care, because you (the leader) don't care.
And a fourth approach, ride when no one else is there (but someone on property so you aren't completely alone.) Horses that are alone cope with it over time. Then when another horse is added, and then leaves, it's not much of an impact.
Hope these tips help you.
"Strength is the ability to use a muscle without tension"