There were two major consequences of this war for the United States.
First, the United States got a huge amount of territory from Mexico. Perhaps most importantly, it got California, which soon became the site of the huge gold rush of 1849. This helped to enrich the United States, as did mineral finds in other parts of the Mexican Cession.
Second, the war helped to cause the Civil War. It reopened the issue of slavery in the territories and caused renewed conflict between the North and the South. This conflict helped to push the two regions apart and led to the Civil War.
The consequences for the United States as a result of the war with Mexico were significant. The war resolved an issue regarding Texas and Mexico and helped us achieve our goals of the ideas expressed in Manifest Destiny. There was a border dispute between the United States and Mexico regarding Texas. Mexico said the boundary was at the Nueces River. This would have made Texas much smaller than it is today. We insisted the boundary was at the Rio Grande River. As a result of this war, the boundary was set at the Rio Grande River. This is the current border.
We also were able to gain a lot of land from Mexico in what is now the southwest part of the United States. We got California, Utah and Nevada. We also got parts of Arizona, Colorado, New Mexico, and Wyoming. By getting these lands, we achieved our goal of expanding from the Atlantic Ocean to the Pacific Ocean. Gaining these lands did increase the discussion and division about the spread of slavery as the North and South differed about whether slavery should or shouldn't in these newly acquired lands. Whether slavery should or shouldn't spread was a factor that led to the Civil War.
The war with Mexico had a significant impact on our country.