Ah well, why bore you with links in idle chatter. Lemme try to sum it up in brief simple language.
The last elections were post-Bush elections, so almost everyone knew Democrats are going to win. The few Republicans that were serious and had invested in the campaigns took a step back after seeing that one 'black' and one woman candidate were fielded by the Democrats. Mccain, with his reputation as a viet war veteran, was the best that could come from the Republican's side. But he also came with a problem, he was too liberal and inconsistent with the traditional views of the Republicans. He wanted to do a complete overhaul of the policies and was not as pro industry as are other Republicans. That was one reason why he could not find a suitable candidate to be a VP. Because of his views, a lot of Republicans were against him. And that was when Sarah Palin came into the picture. She was ready to endorse all sorts of change that he would propose. And at the same time, she was also a woman, to counter Hillary Clinton's status. In brief, that is the story how she got picked, and why even Republicans shy away from her.