The government will have to pass legislation to make the purchase of the land at Ihumātao lawful, because the ministry did not seek the right approvals for using the $29.9m.
The Auditor-General investigated the deal in response to complaints from National and the ACT Party that the government used money from the Land for Housing Fund to purchase Ihumātao against Treasury advice.
The government made a deal with Fletcher Building to buy the land in December last year.
National MP Nicola Willis and ACT leader David Seymour were concerned the deal went against the purpose of the fund as there was no guarantee houses would be built at Ihumātao.
That was despite Finance Minister Grant Robertson having vowed the land would be used for housing.
The Auditor-General's Office did not have any concerns about that aspect of the deal, but it did find the spending was not appropriate because the right approvals were not sought when the government set up the new fund.
"In our view, the intent of the Ministry and the intent of Ministers, was to establish a new appropriation that would provide authority for the purchase of the land at Ihumātao."
"However, because the Ministry did not seek the correct approvals, the expenditure was incurred without appropriation and without authority to use Imprest Supply. For these reasons, the payment is unlawful until validated by Parliament."
The Ministry of Housing and Urban Development failed to request approval from Cabinet to set up the new fund, and it did not put in a request in the relevant legislation, the Appropriation (Supplementary Estimates) Bill, to add the new fund.
Without those correct approvals, "the payment is unlawful until validated by Parliament," the Auditor-General John Ryan said.
The government must now pass the Appropriate (Confirmation and Validation) Act for the payment to be validated, and the Minister of Housing has to explain to parliament what went wrong.
It must also record the unappropriated expenditure in a report, the Financial Statements of the Government of New Zealand 2020/21, which is audited by the Auditor-General.
Treasury had advised against using a fund earmarked for land swaps for housing, which Finance Minister Grant Robertson has said fulfilled all the requisite rules and regulations.
Housing Minister Megan Woods said the government made a technical error when purchasing the land.
"This is a technical error that happens from time to time, it is not unusual. This happened 71 times in the last five years of the previous government, totalling half a billion dollars.
"It certainly isn't the way anyone strives to do things, but it does happen".
The mistake would likely be rectified when the budget was announced next month, Woods said.
Prime Minister Jacinda Ardern this afternoon said the government was confident it was using funding that was allocated for housing.
"It was funding that was intended to purchase land for housing - that has been our intent - the difference here being of course there's a lot of work to go through between all parties to determine where on the land, how it can be most appropriately done and how it can be used for housing for the community.
"We were very clear that this was land [that] once we reached that agreement, that will be utilised for housing".
She said the government knew there was a lot of work to do to determine where and how those houses would be built.
The National Party said the government's purchase of the land at Ihumātao was an outrageous use of taxpayer money.
National finance spokesperson Michael Woodhouse said the government had blundered through the issue, and should never have got involved in the land dispute.
"They were desperate to get out of a situation they themselves created. Fletcher's owned that land, they had a right to develop it, there were going to be nearly 500 houses built, in an area that so desperately needed it.
"And because of a few protesters the government caved, and they did so unlawfully."
ACT Party leader David Seymour said the situation was a serious breach, and showed a "disregard for constitutional protections."
"We want to trust our government, we want a country united in challenging times. But if you can't look after the pennies then the pounds are going to create huge trouble."
He said that in any other government, ministers would be expected to resign.
Ryan said he did not plan to carry out further inquiry work into this matter, as it would be addressed in his role as Controller.