She said the matter was not in the public interest and she would be seeking permanent name suppression.
Judge Dawson said what happens in the court should be open to the public.
"There is no reason to conceal it simply because of his profile as a rugby league player. If it in some way impacts on sponsorship or his standing in the club, so be it. If Mr Locke offends, that should be a natural consequence.''
Judge Dawson said Locke had been suspended from driving in December, 2010. The following month he had been driving south of Whangarei when police pulled him over.
Locke told the police that he did not know he was a suspended driver.
Just over a month later, Locke was caught driving while suspended again.
Ms Basnayake said her client had genuinely not known he was suspended on the first occasion.
"He has been through the paperwork and accepts the misunderstanding was on his part.''
She said on the second occasion he was driving to the hospital to see a sick relative.
"He accepts he should not have been driving.''
Judge Dawson said he would give Locke credit for his previous clean record and the work he did in the community, helping on a programme to stop school bullying.
"Children will learn from what you do, not just what you say.''
Locke declined to comment outside court and was driven away by his lawyer.
Warriors' CEO Wayne Scurrah is on annual leave and was not available for comment.