Judge Fred Morrison Jr. said John Ledford should get back pay to the date of his dismissal and be reimbursed $50,000 for attorneys' fees.
While ALE director, Ledford was the subject of a critical report by the Office of the State Auditor, which said he and his deputy may have used government cars to travel from Raleigh to their homes outside Asheville, a round trip of more than 500 miles.
The audit also accused Ledford of trying to block the investigation of the alleged trips.
At the time, North Carolina Department of Public Safety Secretary Reuben Young said auditors did not prove government vehicles were used improperly and called a recommendation for disciplinary action "inappropriate."
At the end of 2012, before the McCrory administration took over, Ledford sought to be reassigned from ALE director to agent. But Ledford was fired in April for "unacceptable personal conduct" because of the job transfer.
In his ruling, Judge Morrison wrote Ledford was treated "differently than other ALE Special Agents in failing to follow its own ALE internal disciplinary policy" and that Ledford "was a marked man politically."
Contacted Wednesday, a spokesperson for the administration told ABC11 "We don't comment on personnel matters as a policy."
The state can appeal the ruling.
Ledford is a former sheriff of Madison County, he was appointed by Gov. Beverly Perdue in 2009 to lead ALE after his predecessor resigned in the wake of a scandal involving missing guns and questionable spending.