Dominic Cummings has told a judge he did not ask for a company to be given a government contract because bosses there were his "friends".
Mr Cummings, a former senior aide to Boris Johnson, said he would "never do such a thing" and defended the awarding of the contract to Public First.
The Good Law Project has launched a High Court battle with the Cabinet Office, complaining about an agreement struck for focus group and communications support services.
A barrister representing the Good Law Project, which says it uses the law to protect the interests of the public, said the contract was given to Public First because that is what Mr Cummings, Boris Johnson's former senior aide, wanted.
"Public First was awarded this contract because Dominic Cummings wanted Public First to have this contract," Jason Coppel QC told Mrs Justice O'Farrell at a virtual High Court hearing.
"No other provider was considered."
He said more than £500,000 had been spent and told the judge that it was "not strictly necessary" to award the contract to Public First without competition.
Ministers are battling against the claim, while Mr Cummings defended the choice of Public First in a written witness statement prepared for the litigation and seen by the judge.
He said Britain had been facing an emergency because of the COVID-19 pandemic and "the award of the contract without delay" was "entirely justified".
"Obviously I did not request Public First be brought in because they were my friends," said Mr Cummings.
"I would never do such a thing."
He added: "I was the prime minister's main political adviser from July 2019 until November 2020.
"Because of COVID in 2020, this role involved issues of management and procurement far more than it did political advice.
"A big part of my job was solving Whitehall problems - in particular trying to eliminate obstacles and to get the right people into the right roles and the right meetings."
Mr Cummings said he is friends with people involved with the organisation, including director James Frayne, but added he had not met Mr Frayne since 2016.
"James Frayne and I worked on the Euro campaign 20 years ago, other political issues, and set up the campaign to fight the proposed formation of a regional assembly in north-east England in 2004," he said.
"I have talked to them extensively about focus groups and public opinion over many years.
"I knew from my experience that Public First were very good at running focus groups and that its key staff had thought extensively about how people who usually ignore most news and political communication think and might be influenced.
"I knew that I could rely on them to make an extra effort, beyond what they were paid to do.
"I knew they would give us honest information, unlike many companies in this sector.
"Very few companies in this field are competent, almost none are very competent, honest and reliable."
Mr Cummings said he had "no involvement" in contractual arrangements with Public First "or their remuneration" - and declared that their work was "worth more than every penny spent".
"I was under the impression that, provided we were acting genuinely in light of an emergency, that the courts later on would understand that we could not spend weeks on procurement in the normal way when we had hours to act and save lives," he said.