Adam Easton relied on a section of the Commonwealth Electoral Act that states a person can have a valid reason not to vote

Voters during the federal election. A man has won a legal battle in a NSW court after being prosecuted for failing to vote. Photograph: Paul Miller/AAP

A man has won a legal battle in a New South Wales court after being prosecuted for failing to vote in the 2016 federal election, saying voting would have left him feeling “morally corrupt”.

Adam Easton admitted he didn’t vote in the July 2016 election but pleaded not guilty to failing to vote.

He relied on a section of the Commonwealth Electoral Act that states a person who believes it’s his or her religious duty to abstain from voting has a valid reason not to vote.

The self-described agnostic said he believed in “freedom” – an ideology that forms the basis of his view of life and his moral framework.

In a NSW local court judgment from September, published on Wednesday, magistrate David Heilpern dismissed the charge, finding Easton had provided evidence of a valid and sufficient reason not to vote.

It is the first time an elector has had charges dismissed under that section of the act, which the magistrate said was “remarkably subjective”.

“The provision allows for a form of conscientious objection in my view and that is what has been evidenced here,” he said.

Heilpern said Easton gave evidence that voting would have “an adverse impact on his moral framework”.

“Indeed, he states that he could not have voted with his moral integrity intact,” the magistrate said. “He says that to vote would have left him feeling morally corrupt.”

In his initial response to the Australian Electoral Commission, Easton had given four reasons for not voting. He claimed there was no candidate he wanted to vote for and that politicians behaved badly.

“However the totality of the defendant’s evidence presents a deeper, more philosophical objection than that,” the magistrate said. “I am satisfied that his evidence shows an honestly held belief, a moral code that requires him not to vote.”

Easton had a devout but not religious objection to voting, Heilpern said.

“I find that the defendant has satisfied the evidentiary burden by pointing to evidence of a valid and sufficient reason.”