The 74-year-old had been accused of making inappropriate comments to a female journalist, something he acknowledged was wrong as he announced his resignation.
He was also accused of adopting a condescending tone towards Elizabeth Warren.
Matthews had hosted Hardball since 1997.
On Monday evening he opened his show by revealing that it would be his last, saying: "Let me start with my headline tonight: I'm retiring.
"This is the last Hardball on MSNBC and obviously, this isn't from a lack of interest in politics.
"As you can tell I've loved every minute of my 20 years as host of Hardball. Every morning I read the papers and I'm gung-ho to get to work. Not many people have had this privilege."
He said that he had made the decision following the accusations of sexism.
"After a conversation with MSNBC I decided tonight would be my last Hardball, so let me tell you why.
"The younger generations out there are ready to take the reins. We've seen them in politics, in the media, in fighting for their causes. They're improving the workplace – we're talking here about better standards than we grew up with, fair standards.
"A lot of it has to do with how we talk to each other. Compliments on a woman's appearance that some men, including me, might have once incorrectly thought were OK, were never OK – not then and certainly not today. And for making such comments in the past, I'm sorry."
It was unclear whether other staff on the show were aware that he was about to resign. After his statement the show cut to fellow presenter Steve Kornacki who appeared taken aback before saying: "Erm ... that was a lot to take in just now, I'm sure, and I'm sure you're still, erm, absorbing that – and I am too."
Writing in GQ last month, journalist Laura Bassett said: "In 2016, right before I had to go on his show and talk about sexual-assault allegations against Donald Trump, Matthews looked over at me in the makeup chair next to him and said, ‘Why haven’t I fallen in love with you yet?’
"When I laughed nervously and said nothing, he followed up to the makeup artist. ‘Keep putting makeup on her, I’ll fall in love with her'. Another time, he stood between me and the mirror and complimented the red dress I was wearing for the segment. ‘You going out tonight?’ he asked.”
While speaking about Mr Sanders's victory in Nevada, Matthews said: "I was reading last night about the fall of France in the summer of 1940, and the general, Renault, calls up Churchill and says, 'It's over.' And Churchill says 'How can it be? You've got the greatest army in Europe. How can it be over?' He said, 'It's over.' So I had that suppressed feeling."
He later apologised for the comparison.
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies