The prosecution was brought by WorkSafe.
An application to discharge the ministry without conviction "fails at the first hurdle", prosecutor Dale La Hood said.
"It fails at the first hurdle, which is the balance between the gravity of the offending and the consequences of conviction.
"The ministry can point to no consequences other than the very consequences that Parliament intended under the Crown Liability Act."
A conviction would not affect the ministry in any practical way.
La Hood said the hazard with the office layout was "obvious", there had been "sustained client violence" over a period of time, and in ministry chief executive Brendan Boyle's words, client initiated violence was "inevitable".
"The ministry's own experience told it that clients with weapons posed a great risk of serious harm," he said.
"Victim impact statements indicate a culture within the Ashburton office of putting up with, or allowing, or making employees put up with a level of intimidation from clients that caused staff anxiety and consequential emotional harm."
He said changes to make the office safer were "not difficult or costly to implement".
La Hood said the ACC fatality in 1999 proved it was "known that fatalities of this sort can occur".
Defence for the ministry, Brett Stanaway, said it was "very, very unlikely" that the shooting would have happened in Ashburton, and there was no way to predict what would have happened.
He said Tully's actions "could not have been reasonably anticipated".
Stanaway said given there was no causation established, the sentencing exercise must disregard Tully's actions.
"I do make some criticisms, ma'am, of the summary of facts."
Stanaway called the summary "fundamentally wrong".
"They do materially link the outcome of this case with the causation, if you like, and with the suggestion that MSD are in some way linked to and responsible for Mr Tully's actions."
Stanaway said the ministy's level of non-compliance was "at the low end of the spectrum".
He said a starting point for a fine would be at the low end.
The defendant had "responsibly and promptly responded to the events of 2014".
Stanaway said media reporting of the case continued to "erroneously conflate a conviction with causation" and was still "inextricably linked with Mr Tully's actions".
He invited Judge Jan-Marie Doogue to take the ministry's non-compliance with "practicable step A" for the safety of the office as a non-aggravating feature.
"There should be a recognition that there is no aggravating [feature]," he said.
"I don't make that submission lightly because if your honour did follow that procedure, that, of course, will affect the defendant's appeal against sentence rights. It would only be in a situation where there was an aggravating fact that was erroneously taken into account, that the appeal against sentence might lie."
Judge Doogue said there were two or three "point of refinement" she wanted to reflect on overnight.
Her sentencing notes and decision will be released at 3pm tomorrow.