According to MSNBC's John Yang, all indications are that Judd Gregg didn't even tell the White House that he had decided to withdraw his name from consideration for the cabinet before announcing it publicly.
Gregg also released his statement just as President Obama was about to speak at the Caterpillar plant in Peoria, Illinois. (Caterpillar has said that as soon as the stimulus is signed into law, it can begin rehiring laid-off workers.)
All this strongly suggests that Gregg's move was calculated partisan politics, and it underscores this fundamental truth of modern politics: the Republican Party can not, and will not, put partisan politics aside for the good of the country.
With near unanimity, they are utterly incapable of compromise.