the"Speaker has a responsibility immediately and permanently to cast aside all his or her previous political views. I said it and I meant it. My commitment to this House is to be completely impartial as between members of one political party and another. That is what it is about, and I will do my best, faithfully and honourably and effectively, to serve this House in the period ahead."
This wasn't always the case - it was only by the middle of the 19th century that the Speaker's independence from government and impartiality was expected - though Speaker Arthur Onslow, who served between 1728 and 1761 did much to reduce ties with the government.
In the House of Representatives the first Speakers were seen as impartial presiding officers. It was Henry Clay who did most to establish the partisan leadership position that can be recognised today. At the start of a new Congress (and whenever the post becomes vacant) each of the parties choose a nominee - the majority party is able to ensure that their nominee is elected. Once in office they are expected to act as a leading spokesman for the majority party.