Cantor loss will help Democrats: Barney Frank

Kudlow: Dave Brat free marketeer

U.S. House Majority Leader Eric Cantor's stunning loss to tea party challenger David Brat is going to cause Republicans problems and help Democrats some, former Rep. Barney Frank told CNBC's "Closing Bell" Wednesday.

"The Republican House won't act on immigration. That will free up the president to take up some action on the immigration area," Frank said.

"It will also help some Democrats in some areas with the notion that voting Republican and continuing a Republican House means the kind of irresponsibility that you saw with the shutdown of the government and with the debt limit."

Read MoreBrat: Cantor defeat 'was basically a miracle'

NBC / Contributor | NBCUniversal | Getty Images

Cantor announced Wednesday he would resign his position as majority leader after losing Virginia's primary election Tuesday.

Cantor, a seven-term congressman, has close ties to the financial industry. During the campaign, Brat accused Cantor of betraying conservative principles on spending, debt and immigration.

Read MoreCantor announces resignation as majority leader

Frank said there is clearly a significant segment of the Republican primary electorate that holds some views that are not popular with the broader electorate, and that poses a dilemma for Republicans.

"This is going to be the dilemma on things like immigration, on things like raising the debt limit or shutting down the government—two other issues on which they apparently attacked Cantor. So I think this exacerbates the Republicans' dilemma on how they resolve that trouble."

Read MoreStock market not so complacent after Cantor's loss

—By CNBC's Michelle Fox