The 51-year-old has spent the last two-and-a-half years at the helm of the Hive Stadium in what was his second spell in charge of the club.
In that time, Allen guided the team back into the Football League, and they currently sit eighth in the League Two table, just out of the playoff spots on goal difference.
Barnet announced Allen's departure on Thursday afternoon, with chairman Tony Kleanthous saying: "Martin has asked to be released from his contract so he can join Eastleigh. The approach came out of the blue yesterday but it was quite clear that Martin had decided that he wanted to take the opportunity they were offering to him.
"He leaves with our best wishes having done a great job helping to rebuild the football club after our relegation into the National League. Our promotion two years ago was one of my highlights as chairman and I was always aware Martin would be in demand as a result.
"The club is undergoing many changes. We have made the transition off the field needed for us to progress through the Football League and we must ensure our on-field development matches the facilities we have created.
"Martin's departure presents us with an opportunity and we intend to appoint somebody who will help develop our younger players and integrate them into our first-team, as well as bringing in players who can play at a higher standard."
Development team coach Rossi Eames will take temporary charge of the team alongside academy manager Henry Newman.