McHaffie appeared at the Auckland District Court for sentencing yesterday.
Judge Patrick Treston sentenced him to six months' home detention. He had previously handed down the same sentence to Steele.
Crown prosecutor Ben Smith said both men had made a "silly judgment".
McHaffie's lawyer Lorraine Smith told the court that her client was now out of the New Zealand Army.
"Effectively, he's killed his career."
Judge Treston took into account McHaffie's remorse, age and previously clean record.
But he said he had a responsibility to protect the public from the "insidious use of drugs".
"It is clearly a serious matter that needs a firm hand from the court."
Judge Treston said fortunately for McHaffie, the pills did not turn out to be Ecstasy, otherwise he may have been looking at a prison sentence with a starting point of five years.
"So the scam you were subjected to has had some benefit."
Army spokesman Major John Gordon said military police were investigating whether the seven friends are involved. He said he could not go into the details.
Major Gordon said McHaffie and Steele were both still under contract with the military but it was unlikely that they would stay.
Both young men were suspended as soon as the investigation came to light.
"In all likelihood, they will be discharged."
He said the Army did not tolerate drug use, especially given personnel are operating weapons and heavy machinery.