Answer: To resolve controversy over whether new territories/states acquired by the United States would be slave states or free states.
Further detail:
The Compromise of 1850 was passed after an attempt to have all new territories be non-slave states. In 1846, Congressman David Wilmot of Pennsylvania introduced an amendment to an appropriations bill, stipulating that any territory gained from Mexico (after winning war vs. Mexico) would be free, not allowing slavery. [Don't think of Wilmot as an abolitionist, though. He wanted new territories to be free of blacks, preferring whites-only territories.] Wilmot's amendment passed in the House of Representatives, but was unable to get approval in the Senate. The Compromise of 1850, a package of five bills passed by Congress in September of that year, sought to accommodate some of the issues both South and North were debating over during those years. The balance between slave states and free states continued to be an issue.