An Australian Defence Force (ADF) reservist sacked for anti-gay comments on social media has won a Federal Court battle against his dismissal.

Bernard Gaynor was a Major in the Defence Force who stood for Katter's Australian Party in Queensland.

He was sacked in 2013 by the Chief of the Defence Force after making comments on social media including one that said he did not want gay people teaching his children.

"I wouldn't let a gay person teach my children and I am not afraid to say it," a Twitter post from Mr Gaynor read.

Mr Gaynor was also embroiled in a public stoush with high-profile transgender Army officer Cate McGregor, and issued a series of press releases criticising the ADF's participation in Mardi Gras.

"Defence gave approval for its proud uniform to be paraded through the streets of Sydney during the Mardi Gras, sharing the road with pimps, prostitutes and purveyors of moral decadence," Mr Gaynor's press release read.

"The supposedly apolitical ADF is now marching to the beat of a very political tune, drummed up by those who demand gay marriage and take pleasure in ridiculing Christianity.

"Defence is bending over at every opportunity to help gay members but has hauled me over the coals for expressing my religious and political beliefs."

The public comments were deemed at odds with military rules.

That includes a ban on posting material on social media that is offensive towards any group based on personal attributes including race, religion or gender.

But on Friday, Federal Court Judge John Buchanan found the comments had been made in a personal capacity and were supported by the implied right to freedom of political communication in the constitution.

"I conclude that the applicant's commission was terminated because of the publication of his private views about political matters," the statement read.

"The fact that those publications were at variance with ADF or government policy... does not appear to me to be sufficiently connected with any legitimate legislative aim to displace the freedom of political communication implied in the constitution."

Mr Gaynor, who was a Queensland Senate nominee in 2013, had his Katter's Australian Party membership suspended and nomination deemed invalid because of the comments.