Defence lawyer John Tannahill argued there were "no victims" in the offending and Selkirk had worked hard to make amends for his "foolish" actions.
Mr Tannahill said his client had also taken steps to start a viable new career, recently completing an exam at the New Zealand Institute of Sport.
Judge Morris said the entire community suffered when officials behaved corruptly. She said it was crucial New Zealand upheld its record of having one of the world's least corrupt civil services.
However, she said Selkirk had a low risk of re-offending and appeared to have learned from his mistakes. His guilty plea, though not made at the first opportunity, also helped reduce his sentence.
"This was an immature and monumentally misguided attempt [to help a friend]," the judge said. Judge Morris also said Selkirk was still young and had done what he could to put things right.
Selkirk was convicted and sentenced to four months' home detention and 100 hours of community work.
Meanwhile, the man Selkirk tipped off faced charges of breaching the Medicines Act and corrupt use of official information.
On the first charge he faced a pre-trial application on February 25. On the second charge, he was expected to be sentenced on February 9.