The man was a manager within a wider-government agency when the offending occurred.
He remains working for that agency but is now in a more senior role - a promotion that came after he disclosed his offending.
Suppression orders prevent the Herald from publishing any further details about his occupation, role or workplace.
Court documents provided to the Herald reveal that on November 23, 2017 the man placed a small USB spy camera in the changing room of a gym in the Auckland area.
The name and location of the gym are also permanently suppressed.
The police summary of facts revealed the camera was placed under the sink of a unisex changing room - viewing a bench area of the changing room.
Soon after, one of the victims discovered the camera and alerted the gym manager.
The camera was removed and police were called.
They found a total of 39,360 still images and 12 video files on the camera, showing six victims in various states of undress or naked.
The man eventually pleaded guilty to a representative charge of intentionally making an intimate visual recording of another person.
A representative charge is used when police believe an offender has committed multiple offences of the same type in similar circumstances.
The man faced a maximum penalty of three years in jail.
But, despite police opposition, Judge Clare Bennett granted his application for a discharge without conviction, and his request for permanent name suppression when he appeared in the District Court last week.
"This is a case involving the surreptitious recording of intimate visual images," Judge Bennett said.
"Offending like this is serious."
But she said the offending was "an isolated incident" and she was satisfied that "the direct and indirect consequences of a conviction would be out of all proportion to the gravity of the offence".
She accepted that if the man was convicted, he might lose his job and both his and the government agency's reputation would be negatively impacted.
He would not be able to travel internationally, and there would be a significant impact on his family relationship.
Judge Bennett said the man was of previous good character and had never appeared before the courts.
There was an "abundance of material" supporting his application.
She explained that the man's childhood was "marked with hardship and deprivation".
The court heard that the offending "may be seen as a response to his feelings of inadequacy which over time led to a regime of strict exercise and overindulgence in alcohol to deal with stress".
"It is submitted that [the man] began suffering from erectile dysfunction, which exacerbated his sense of inadequacy," Judge Bennett said.
"This drove his passing interest in pornography into an obsession reaching the point of occupying three to four hours a day.
"It is within this context that the alleged offending occurred."
The court heard that if the man lost his job he would not be able to pay his mortgage and be forced to sell his family home and move into rental accommodation.
"The sale of the family home would be a great stressor on the marriage and [he] is concerned it would be the breaking point in the relationship with his wife," Judge Bennett said.
She said the man was "extremely remorseful" and had taken significant steps towards rehabilitation including 73 sessions with a psychotherapist.
"A conviction will likely have a considerable impact on your employment and on your family relationship," Judge Bennett said.
"I am satisfied in the circumstances that the consequences would be out of all proportion to the gravity of the offending.
"I discharge the defendant without conviction ... in addition to my decision ... I also make an order for costs in the sum of $500".
She also granted the application for permanent name suppression.
"In [this] case, I am satisfied that should his name be published he will suffer extreme hardship and ... his employer would likewise suffer extreme hardship from the publication of his name."