Blow to Obama
Al Jazeera's Rob Reynolds, reporting from Washington DC, said it was an embarrassing development for the Obama administration after weeks of political wrangling with Republicans who have been staunchly opposed to the $789bn stimulus package.
Obama, who vowed to boost bipartisan co-operation in Washington, said that "the one thing I want to make sure of is that people don't take from this the notion that we can't get Democrats and Republicans working together".
"I am going to keep on working at this," he told reporters travelling with him on Air Force One in Illinois.
But more than three weeks after being sworn in, Obama, who pledged to hit the ground running to tackle the economic crisis, is still trying to form his 15-member cabinet.
The commerce department, while not central to the fight, plays an important role in promoting US business around the world.
Gregg was the second nominee for the post to withdraw after Bill Richardson, the governor of New Mexico, withdrew because he was facing a legal inquiry.
Tom Daschle, the former senator who was to head the health and human services department, and Nancy Killefer, who was to be the country's chief performance officer, have also stepped aside over tax problems.
Robert Gibbs, the White House press spokesman, said Gregg "was very clear throughout the interviewing process that despite past disagreements about policies, he would support, embrace, and move forward with the president's agenda".
"Once it became clear after his nomination that Senator Gregg was not going to be supporting some of President Obama's key economic priorities, it became necessary for Senator Gregg and the Obama administration to part ways."
Gregg, 61, is a former governor of the state of New Hampshire who previously served in the House of Representatives.
He has been in the senate since 1993 and currently serves as the top Republican on the Senate Budget Committee, where he is known for battling against high spending programmes.
The commerce department has jurisdiction over the Census Bureau, and the Obama administration has recently taken steps to assert greater control.
Republicans harshly criticised the move, saying it was an attempt to politicise the census, which takes place every 10 years.
The Congressional Black Caucus and a group representing Hispanic politicians have raised questions about Gregg, noting that as chairman of the senate panel overseeing the Census Bureau budget he frequently sought to cut funding that they believed led to an undercount of minorities.