He did not leave the show on his own accord.
Eric Millegan was written out of the show in the 9th season due to a creative decision by the writers. The character of Zack Addy was moved to a new position as a forensic anthropologist in the Pentagon, allowing the writers to focus on new storylines and dynamics within the main cast.
It's important to note that there were no reports of any issues between Millegan and the show's creators or producers. His departure was simply a result of the show's evolution and the writers wanting to explore new avenues for the characters and story.