This is the kind of thing that seriously makes me wonder why McCain chose Palin as his running mate. I was completely undecided up until that point, and this is why. He seems like one of the few level headed R's left in DC, who'd probably get on his party's case more if he didn't think it would end his career.
I figure the GOP went, "OK, we have a moderate that sane people will agree with. Now we need someone who will appeal to our base." And thus the worst decision since Quayle was made.
He also wanted a woman because he hoped to pick up dissatisfied Hillary supporters and the gender gap was too wide for him to have a chance as things were at the time. The other criteria that his campaign was looking for was somebody young, vigorous, and charismatic to offset Obama's advantage with those characteristics.
Of course, it was hard enough to find a charismatic, young, female Republican to begin with. Then finding one who could appeal to the base, (which basically meant pro-life) was virtually impossible. Once they found her, they failed to properly vet her, so they really didn't know what they were getting to.