Mr Mallard said he knew the young man in question: "I have seen him at particular occasions in the past. I know a member of the family better, but not well, not friends or anything like that."
He said MPs wrote hundreds of support letters, for everything from helping with letting agencies to banks. Writing one for someone before the courts was a more serious matter, and Mr Mallard estimated he would agree to do about one in every four requests.
He didn't know if other MPs did the same, "but I'd be surprised if they didn't".
"I have been an MP for a long time [he was first elected in 1984], know my community and know the families in it relatively well, and work to try and get the best outcome for the community.
"And in this particular case I think depriving this person of their career prospects could have been adverse to the community as well as to that person."
In May 2014, Maurice Williamson resigned as a minister after he phoned police about their investigation of businessman and National Party donor Donghua Liu, who had been arrested for a domestic assault.
Mr Williamson subsequently said the call was an error of judgment, but insisted it had not been made to influence the police investigation. He was making the inquiry as an MP, he said.
"In 27 years as an MP, when I've hung up the phone from calls to ACC or the police or the district health board advocating on behalf of somebody, I've always thought that was my job."
After announcing the resignation, Prime Minister John Key said it was a long-held rule that MPs don't interfere with the police. "The moment he made the phone call, he crossed the line."
Mr Mallard said that when he was a Cabinet minister, he never wrote support letters such as the one he sent for the 24-year-old.
"I just thought there was a much finer line when you are part of the [government] Executive. Whereas an MP, as far as the court is concerned, might have a certain position, but there is no power relationship."
He submitted the letter to the court in the knowledge that it would be on public record, and that was how it was available to media.
"It was an open and transparent thing. As the judge said, they look at references and sometimes take notice of them, and sometimes don't."
Media attention wasn't a consideration when he wrote the letter, Mr Mallard said.
"Frankly the reaction [to media reports] of just about everyone in the electorate is summarised as WTF, you know. Of course MPs provide references ... it is like being a local councillor, or the mayor, or the local vicar."