Along with the ideas of more leg, less rein, and making the arena gate a place of "work" rather than of "reprieve," I'd like to add that, the more attention that you pay to the gate, the more attention the horse will pay to it. Think of this as the corollary to the idea of remaining very calm and working past a scary object or scenario -- don't anticipate, don't fixate --Respond, don't react.
Don't treat that span of fence where a gap sometimes appears any differently than the corner where the oak tree is, or the short side where you can see the neighbor mowing his lawn, or any other distracting thing in or around the arena. All it is is another distraction to work through. Treat it as no big deal, put your horse back together between your aids (to whatever degree his ability/training level will allow), and keep riding forward with purpose.
Convince him that what you are telling him is far more pressing than whatever fantasies of hay-munching relaxation are galloping through his head. Become interesting to him. Or, barring that, throw so many requests and transitions his way that he absolutely must focus on you (rather than the gate) to keep from getting his legs tangled. The gate-draw will fade with consistent work over time.