It’s still a source of astonishment that the Democrats gained a net two seats in the U.S. Senate this month.

With two independents from Vermont and Maine also caucusing with Democrats, it is a 55-45 Senate for the Democrats in January.

That’s truly astonishing, considering that this was the GOP’s year. Not only was the party in power in the presidency facing a dreadful economy, but Democrats had to defend twice as many seats — 23 of the 33 up in this election, when a third of the 100-member Senate faced the voters. Moderate Democrats in several “red” states were retiring, opening the way to GOP challengers.

Yet again and again, the GOP failed to capitalize on its opportunities.

Political analyst Charlie Cook, writing in The National Journal, put in a good word for the GOP professionals — including U.S. Sen. John Cornyn of Texas, head of the National Republican Senatorial Committee — who might be scapegoats for the result.

“Republicans have problems matching Democrats in recruiting candidates and managing primaries because the GOP base simply not does allow the party to anoint the strongest candidate in a race,” Cook said.

In 2010, the party committee tried to push candidates in primaries who were conservative, but not conservative enough for the “tea party” enthusiasts. The committee was much-criticized for these “establishment” tendencies. And in several key states, the “establishment” candidates were pushed aside by tea party favorites.

The result? The GOP threw away seats by nominating candidates of — how does one say this politely? — advanced political views. One example was the GOP primary in Delaware in which a respected former governor, expected to win the Senate seat, was thrown over for a candidate who had some weird comments to make about witchcraft.

A “true blue” or “raging red” candidate works better in the U.S. House, where seats are drawn in most states by a political process that gives Democrats or Republicans a solid majority. Even an ultra-liberal Democrat or an ultra-conservative Republican has a shot in those circumstances.

States, alas, often contain diverse electorates — and the electorates were even larger and more diverse in 2012 than in 2010. A presidential election year typically brings out a bigger turnout.

Further, the battle between “establishment” and “tea party” favorites continued in the 2012 primaries.

The Indiana primary resulted in the defeat of the aging but prominent Sen. Richard Lugar, thrown out for a “tea party” candidate with abortion views that simply did not play well with the general election electorate.

Abortion was a problem for several candidates favored by the party’s right. Missouri was considered a sure bet but similar statements cost the GOP a chance against the vulnerable incumbent senator there, Claire McCaskill.

At the same time, observed conservative columnist Quin Hillyer in National Review, the “atrocious” Senate results spanned more than the obvious casualties: “Bright new conservatives lost. Foot-in-mouth conservatives lost. Establishment retreads lost. Moderates lost. Way too many people lost, even in solidly ‘red’ states,” Hillyer wrote. “Republicans obviously are missing something.”

However widespread the GOP assessment of the Senate returns, the bottom line is one that should concern party leaders.

Electability is often derided as a qualification by those who vote based on their unbending convictions, but it’s what parties have to be concerned about: “At the end of the day, the losing team always looks for a scapegoat, and the NRSC is a natural one, but the fault truly lies with a recalcitrant and inflexible base,” Cook said.

It’s a striking part of this unusual election year.