Because the people there were tired of their state being looked at as a competitive state for the "right democrat" when it was actually solidly republican, and they knew that the only way they could dispel that notion was to not only vote straight republican for governor, senator, and all the row offices, but also to vote as heavily as possible for Donald J. Trump.
People were not thinking that as they voted....
2008 and 2016 were both perfect storms.
In 2008, the yellow dog democratic force was still enough, combined with the very anti Republican mood that year from Governor Matt Blunt and the Bush Administration, and the fact that Obama was a good fit for the Midwest that the Obama was almost able to carry the state.
In 2016, the Republican nominee had a campaign that was literally tailor made for the state, and the Democratic nominee essentially called most of the state deplorable. Combine that with Ferguson, and a very anti-incumbent mood, gave Trump the state by 20 points and gave the GOP the governorship.
I think the 2012 numbers much more accurately reflect the state. We will know for sure in 2018. Can McCaskill win? Can Democrats hold the Auditors office in 2018? I think the answer to both is yes, but will heavily depend on the campaigns, the national climate and the state climate in 2018. My early guess is that the offices split in victories. But we will have to see.