Once again, Santorum lost his seat due to his support for the Iraq war in an anti-war State and the name recognition of his opponent. As you should know, that election was a terrible one for almost all Republican candidates, especially in PA (Lynn Swann lost to Rendell by a 20 point margin).
The Specter endorsement (mentioned by you in another post) meant almost nothing in that election.
Can a candidate recover from a loss? Gingrich lost twice (one a substantial loss) prior to being elected to the Congress. Romney lost in his bid for the Senate. Bill Clinton lost a House race and a Gubernatorial election prior to being elected President.
I didn't like Santorum’s endorsement of Specter. I also didn't like President Bush's endorsement, but I understood the politics of both. Who knows how history would have been altered had Toomey been the nominee. Given how blue PA became and the fact that Toomey squeaked out a victory in a big Republican year (2010), I think it likely that Toomey would have also lost in 2004.