Two allegations of sexual misconduct against Mr Matheson by a former member of his staff have been upheld.
The MP for Chester allegedly invited her on a private trip abroad, which was found to be "sexually motivated".
He admitted he had committed a minor breach of the code and tendered his resignation with "great sadness".
The Independent Expert Panel parliamentary watchdog had recommended the Labour MP was suspended from the Commons for four weeks.
A spokesperson for Labour said there must be a "zero tolerance for sexual harassment", adding the party acted immediately following the report findings.
According to the report, the invitation for the trip abroad "was sexually motivated, unwanted, and had placed the complainant under pressure and intimidated her".
During a work event outside Parliament, he also "linked arms with her and made personal comments about her appearance while looking at her suggestively".
The report also found he made her hold his hand as they left and insisted on accompanying her to a bus stop and once there invited her back to his flat, kissed her twice on the forehead and attempted to kiss her on the mouth.
The commissioner concluded these were all unwanted and unwelcome sexual advances.
In his resignation statement, triggering a by-election, Mr Matheson said he accepted he had committed a minor breach of the code and had hoped that "an honest and open approach" would stand him in a "fair" light.
He said: "This has proven not to be the case and I am dismayed that I have been found guilty of several allegations that I know to be untrue."
"Indeed my insistence on what I know to be true - that I had no sexual motivation in this matter - was held against me as a refusal to accept my guilt, and caused an increased sanction which I felt was disproportionate."
He said he had appealed against the four-week suspension which he believed to be "an excessive and unfair penalty" but he was now unable to "challenge the process further".
"I believe that the honourable and right thing to do now is to resign my seat and seek to rebuild my life elsewhere," he added.
"I once again apologise to the complainant in my case, for the hurt I have caused."
It is understood the Labour Party launched an investigation and immediately suspended Mr Matheson from the party membership in light of the report.
He was also asked to stand down as City of Chester MP by Labour.
A spokesperson for Labour said: "This is an incredibly serious case.
"There must be a zero tolerance for sexual harassment and the Labour party has acted immediately following the ICGS [The Independent Complaints and Grievance Scheme] findings.
"We will now select a candidate that the people of Chester can be proud to vote for."
Mr Matheson's resignation will trigger a by-election in the City of Chester.