To what extent did the Mexican War promote the American national interest?
The Mexican War definitely promoted the U.S.'s interests. The acquired territory was quite rich and was just waiting for people to exploit those riches. Within one year after the end of the war there was a gold rush at Sutter's Mill in California, and after the Civil War there were gold and silver strikes all over the West. California was also rich in ports and eventually these ports would be used to get in on the Chinese trade. Northern and central California would be valuable for their long growing seasons and great soils. This region would be known for wine, grapes, and livestock. In the twentieth century Western tourism would also be valuable to American interests.
At the time, the acquisition of the Mexican Cession proved dubious as the United States invaded disputed territory in order to bait Mexico into a war, but after the war, the acquisition was great for American nationalism. The issue of ownership in the Oregon territory was already solved, and the Mexican War gave the United States a claim to the entire continent, save for a little piece in Arizona purchased in 1853 as the Gadsden Purchase. Many expansionists were starting to talk about the United States finally being able to achieve its democratic and economic destiny.
The Mexican war was attributed to America's expansionist agenda. There were vast unoccupied lands in North America in areas like Georgia and Louisiana but Texas and California still appeared lucrative. The Mexicans conditionally accepted settlers from the North and as their numbers swelled the economic potential of the region continued to unravel. Americans sought to take away the privileges enjoyed by the locals and instead impose centralized authority that would be beneficial to them.
The Americans made major gains after the war as mentioned especially with regards to agriculture, mining, industry and commerce. The Mexicans were deliberately provoked into a war which they were ill prepared for and their attempts to protect their territory failed. This led to the easy annexation of Texas, settlement in California and New Mexico with minimal cost to the Americans.
I would argue that it advanced the American national interest significantly. It gave the US a great deal of territory, territory which turned out to be very valuable. Just think about what California has meant to the US. Besides the Gold Rush it has been and remains very important to US agriculture and to many other industries. Gaining California was very much in the national interest and the US gained much else besides.
Taking this territory did help to bring on the Civil War, but that war was likely to happen no matter what. In addition, the war ended slavery, which is surely a good thing as well.
The US entered the Mexican War for what we would see as immoral reasons, but it is hard to argue that the war was not in the interests (in the long term) of the country.