Tim Sloan's decision to step down as chief of Wells Fargo hinged in part on a looming congressional committee meeting on banks next month, CNBC's Jim Cramer said Friday.

The top brass of the big banks will be in Washington, D.C., on April 10 for the House Committee on Financial Services hearing on banks. The committee, headed by Rep. Maxine Waters, would surely focus on Sloan, Cramer said.

"No matter what he said or did, the fact that he served as an executive at Wells Fargo under John Stumpf, now disgraced, meant that as far as Congress is concerned he's guilty until proven guilty," the "Mad Money" host said.

Stumpf was chairman and CEO of Wells Fargo when the embattled bank was fined $190 million after being accused of opening fraudulent accounts without their customers' consent. Sloan, who served more than three decades at the firm in total, succeeded him as CEO in October 2016.

Cramer said Sloan would have been too easy of a target at the hearing because he was a high-ranking official at the bank during the time of the scandal. That's even if Sloan had no knowledge of the scheme, he added.

"One look at the make up of that committee made it obvious that Sloan was going to be a punching bag," Cramer said, adding that Senator Elizabeth Warren, a candidate for the Democratic presidential nominee is calling for him to be put in jail.

"Politically, it's just such a slam dunk—bankers aren't popular to begin with and Sloan also had to live with the sins of his predecessor," he said.

Sloan cited the scrutiny surrounding his leadership when he stepped down, calling it a "distraction" for the company's forward progress. In January, Sloan told Cramer he would step aside if he felt his presence was hurting the turnaround. That was after Wells Fargo delivered a "very strong quarter and a very good year."

Earlier this month, the board granted Sloan a 5 percent pay raise to $18.4 million and a $2 million performance bonus, Cramer noted.

"I'm not saying we should feel bad for the guy ... He'll be fine," he said. "But I will say that Sloan was asked to clean up the Augean Stables and from what I can tell he's done a good job at that Herculean task, without derailing the earnings."

Sloan, being an executive from the Stumpf-era, made the smartest decision for both him and the bank's shareholders, Cramer said.

In the end, Sloan did not want Wells Fargo to go through the fire that he was in, he said.

"Tim Sloan did the right thing and took one for the team, which I think is actually something worth celebrating," he said.

The House Committee on Financial Services will hold its banks hearing titled "Holding Megabanks Accountable: A Review of Global Systemically Important Banks 10 years after the Financial Crisis" at 9 a.m. ET, on April 10.

Shares of Wells Fargo fell 1.57 percent Friday. The stock is up nearly 5 percent this year.