Pat Buchanan was for affirmative action before he was against it.
President Richard Nixon, a Republican, became the first president to impose affirmative action when his Department of Labor imposed the Philadelphia Plan upon that city's construction industry in 1969. The Plan was soon followed by affirmative action rules (Order No. 4) for all federal government agencies and contractors, setting in motion profound changes in the American workplace.
Buchanan, a Catholic, was hired by Nixon as a speechwriter, but later was drafted to help organize the "Catholic vote" to get behind Nixon in 1972. This was part of Nixon's attempt to create a "new majority" for the Republican Party.
Here is a 1971 document* from the Nixon Archives, written by Pat Buchanan, showing Buchanan proposing a strategy for Nixon's outreach to Catholics.
In it, he suggested that Nixon "instead of sending the orders out to all our other agencies-- hire blacks and women-- the order should go out-- hire ethnic Catholics preferable [sic] women, for visible posts. One example: Italian Americans, unlike blacks, have never had a Supreme Court member-- they are deeply concerned with their 'criminal' image; they do not dislike the President. Give those fellows the 'Jewish seat' or the 'black seat' on the Court when it becomes available."
So when Buchanan criticizes affirmative action, or criticizes Judge Sotomayor as "Miss Affirmative Action", he's being a hypocrite. That's because he's also criticizing his own path to political prominence (not treating all Americans the same) and the policies of preferential hiring that Nixon created and that he himself recommended that Nixon employ. He even suggested that the President appoint someone to the Supreme Court not based on merit alone, but also based on the person being an "Italian American."
*Box 3, Folder 52, Contested Materials: White House Special Files, Nixon Library-Yorba Linda, National Archives and Records Administration