The Lib Dem MP was giving evidence at a special election court being held in Edinburgh.
Four constituents have raised a court action against him under the Representation of the People Act 1983.
They say he misled voters over the memo which was leaked before May's election.
The contents of the memo, published in the Daily Telegraph at the start of the election campaign in April, claimed that SNP leader and Scottish First Minister Nicola Sturgeon would secretly prefer Tory leader David Cameron to remain as prime minister rather than his Labour opponent Ed Miliband.
The newspaper said her comments, reportedly made to the French ambassador, undermined claims that she wanted to build a "progressive alliance" with other left-wing parties.
Mr Carmichael - who was Scottish secretary in the Tory-Lib Dem coalition before the election and is now his party's only MP in Scotland - authorised the leaking of a civil service memo by his special advisor.
Both the ambassador and the first minister denied the accuracy of the civil service memo.
At the time of the leak, Mr Carmichael denied any knowledge, claiming in a TV interview the first he had heard of it was when he received a phone call from a reporter.
The court heard how a Cabinet Office inquiry into the leak was launched shortly after the newspaper article was printed on 3 April.
Mr Carmichael told the court he was "less than fully truthful" with the inquiry initially.
However, five days after he was re-elected the MP told the official inquiry that he admitted full responsibility for sanctioning its release to the newspaper by his special advisor Euan Roddin.
The MP also accepted the details of the memo's account were not correct.
Mr Carmichael told lawyer Jonathan Mitchell QC that because Mr Roddin released the document, he could have avoided telling any lies to the inquiry.
He added: "I thought I could have truthfully said I didn't leak it."
The MP said: "I am not disputing the fact that I was south of the standard that would be expected of the (ministerial) code."
Mr Carmichael said that he thought the government probe would not uncover the truth of how the Telegraph came into possession of the document.
He said: "It has to be said that most leak inquiries very rarely establish the source of the leak."
But Mr Carmichael said he decided to reveal his role in the process after becoming concerned about his special advisor's wellbeing following the election.
Earlier Fiona Grahame, one of four of the Lib Dem MP's constituents who raised the court action, gave evidence to the court..
The 57-year-old, from Sandwick in Orkney, described herself as an active member of the Scottish Green Party who had stood as a candidate in a by-election.
Ms Grahame said she was "shocked" when she discovered Mr Carmichael had authorised the leak.
She told the court: "It was hard to get your head around the fact someone you know and trusted would do such a thing - as lie."
"I was shocked that he lied to us."
Shetland MSP Tavish Scott, the former leader of the Liberal Democrats in Scotland, told the election court it was a "political show trial".
He said: "It's being funded by people, principally the nationalists, who don't like opposition."
Mr Carmichael's lawyers argue his actions were political and did not affect his re-election.
The election court in Edinburgh is hearing evidence from six witnesses over four days. Legal argument was earlier heard in September.
The case is believed to be the first of its kind in Scotland for 50 years.
The petitioners argue his actions call into question his integrity as an individual and his suitability to represent the constituency at Westminster.
Judges ruled last month the legal challenge could proceed.
September's hearing was broadcast and streamed live online. The evidence from these latest six witnesses will not be broadcast, but the lawyers' closing statements may be.
The two judges, Lady Paton and Lord Matthews, will present their judgement to the House of Commons at a later date.
Orkney and Shetland MP Alistair Carmichael has told a court he thought it was "politically beneficial" to leak a memo about Nicola Sturgeon during the general election campaign.