Chris Grayling has insisted that a £33 million payout to Eurotunnel was a "sensible" part of planning for a no-deal Brexit scenario.
Mr Grayling said that the decision had been made on the recommendation of the Department of Health to ensure that vital medicines could reach the UK.
The minister, who has been increasingly ridiculed in recent months, said he had no intention of resigning as long as he was wanted by Theresa May.
Eurotunnel had started legal proceedings over what they deemed a botched government process when handing out ferry contracts.
Mr Grayling said the payout was a decision made "collectively" by ministers.
"The decision that we took last week was taken by the Department of Health to protect drugs supplies to the UK in a no-deal in the same way as these contracts were let in the first place, after a discussion and a decision by a Cabinet committee because we had to prepare for all eventualities," he said.
"We are still working for a deal, we don't want to leave without a deal, but we have to be ready for all eventualities. This was a sensible part of contingency planning to make sure that we had all resources that we needed, all the medical supplies that we needed for the NHS.
"That is why the Cabinet took the decision that it did. That is why we collectively last week decided, however regrettable the Eurotunnel court action was, that we had to take a decision to protect the interests of the country in the circumstances of a no-deal Brexit. And that is the right thing to do."
Asked if he felt under pressure to resign, he said: "I will carry on serving the Prime Minister as long as she wants me to."
Mr Grayling, urged by Labour MP Peter Kyle to apologise for his decision, replied in the Commons: "I very much regret the fact we were taken to court - it was a risk that we acknowledged was there but I stand by the decision to make sure that we could guarantee the supply of drugs to the NHS in the event of a no-deal Brexit."
Shadow transport secretary Andy McDonald added: "What he is laying bare today is that advice he received, he's acted in contravention of that advice and he has lost.
"What we're asking for is not an absence of preparation for contingencies, what we're asking for is a modicum of competence and he's singularly failed."
Mr Grayling replied: "We did not receive legal advice saying 'do not do this', we received legal advice saying that there was a risk in taking this approach and we judged collectively across government that this was a risk that was necessary to take in the national interest."
He added the settlement with Eurotunnel was separate to the issue of Seaborne Freight and "struck in a way designed to ensure that the taxpayer actually receives value through the addition of important facilities at the border that will smooth the flows".