Answer: to prevent the spread of slavery to any territory won from Mexico during the war.
Explanation: The end of the 1840s saw the Congress battling the issue of whether to permit slavery in the territories organized in any new land acquired from Mexico and as such, during the Mexican-American war, Congressman David Wilmot introduced the Wilmot Proviso, which was a proposal to ban slavery in any new territory acquired from Mexico and although the measure passed in the House of Representatives it failed in the Senate. As such, the main purpose of the Wilmot Proviso was to prevent the spread of slavery to any territory won from Mexico during the war