The issue of slavery was indeed the major problem ignited by the acquisition of territory from Mexico; but the true issue was whether slavery should be extended to the territories. Those on both sides of the slavery issue saw the new territory as problematic. Ralph Waldo Emerson commented:
The United States may conquer Mexico; but it will be as the man swallows the arsenic.
John C. Calhoun, a staunch defender of slavery called the lands ceded from Mexico:
the forbidden fruit; the penalty of eating it would be to subject our institutions to political death
Within three months of the end of the Mexican-American War, Congressman David Wilmot introduced a resolution into Congress which would prohibit the introduction of slavery into any area acquired from Mexico. In offering his resolution, Wilmot argued passionately on the House floor:
God forbid that we should be the means of planting this institution [slavery] upon it
Wilmot's proviso was twice passed by the House but rejected in the Senate where John C.Calhoun, in response, offered the Calhoun Resolutionswhich argued that prohibiting slavery would violate the Fifth Amendment to the Constitution which prohibited taking of property without due process. Although Calhoun's resolutions never came up for a vote, it did inflame the slavery debate further. Senator Thomas Hart Benton said that the two resolutions (Calhoun and Wilmot) were like a pair of scissors. Neither alone could do much, but together they could cut the Union in two.
The addition of these territories caused a problem for the United States because it reopened the issue of slavery.
Before the war with Mexico, the issue of slavery in the territories was more or less settled. There was tension between North and South (as in the Nullification Controversy) but there were not any huge bones of contention. But the war changed that. When the US took the Mexican Cession, Congress had to decide whether that land would be slave or free. The conflict over this issue led to such things as the Compromise of 1850, which did more to exacerbate tensions than to reduce them. Not much more than a decade after the war, the Civil War began, in part because of the conflict that arose over slavery in the Mexican Cession.