James Polk was responsible for a large amount of land that was obtained from the United Kingdom (the Oregon Territory) and from Mexico (New Mexico and California).
With the addition of a large amount of land, there began to be a quarrel between the North and the South. The Wilmot Proviso was a law introduced by David Wilmot of Pennsylvania in 1846 that said basically that any land that was obtained from Mexico would be free from slavery.
This upset the South, who favored slavery. James Polk who was the President during 1947 suggested a form of the Missouri Compromise which originally admitted Maine as a free state and Missouri as a slave state. Polk suggested drawing a line extending the Missouri Compromise, along 36í 30í Latitude to the Pacific Ocean, and that anything below the line (Southern California, New Mexico, and Arizona) would allow slavery.
And anything above the line (Northern California, Oregon, Idaho, Washington, Utah and Nevada) would be slave free. Ultimately the Wilmot Proviso passed the House of Representatives several times but it could never get enough votes in the Senate, so it never went into effect.
Because of this, the issue of slavery was never formally banned from the new area, and it was a hotly contested issue that continued to fester. Several smaller bills passed the Senate and the House of Representatives that had different elements in it.
Efforts to make different states slave free angered the Southern delegation, and several times members of the Southern states considered leaving the Union and secession in 1850 an 1851, but they ultimately stayed with the Union. They were still angry however, and ultimately it was these tensions and stresses that caused the eventual Civil War in 1865.