In the 1964 presidential election, voters overwhelmingly rejected Barry Goldwater, and elected Lyndon Johnson. Yet the polling data revealed that voters were more likely to agree with Goldwater on major national questions. Historian William F. Buckley, Jr., reports that
no less than 94 percent of the American public believed that the government had been lax in security ... 88 percent agreed that prayer in schools should be reinstated ... sixty-four percent believed that Goldwater was uniquely serious about wanting to curb extremist groups; 60 percent felt that government power should be trimmed; and, again, 60 percent agreed that state welfare without stringent eligibility rules encouraged laziness. A solid 50 percent believed that Goldwater would do a better job than Johnson on the issue of morality and corruption in government.
So most voters agreed with Goldwater, but voted for LBJ. Why? Possible answers: the 94% statistic about security may have overstated the public's sentiment in the wake of Walter Jenkins scandal. Johnson had been coy on the school prayer issue, simply deferring to the Constitution's separation of powers rather than expressing a concrete view. In recent legislative matters, Johnson had departed from his segregationist views long enough to endorse the 1964 Civil Rights Act during an election year; Goldwater had departed from his integrationist views long enough to cripple his political capital by opposing the same legislation, not in principle, but on a technicality.
It was not the first time, nor the last, that the American voters would choose a candidate with whom they disagreed and rejected a candidate with whom they largely agreed. These are the cases which keep campaign managers employed.