“In the 1862 midterm election, held a little over a month after the Preliminary Emancipation Proclamation, Lincoln and the Republicans got shellacked.”

Link. Doing the right thing is often a losing strategy. At least In the short term.