There were multiple reasons for acquiring over California like:
A) California was rich in resources and was located against a major body of water.
B.) US Army wanted to defeat Mexico in the war.
C.) Soil was fertile and supportive for almost every kind of Agriculture.
Hope this helps!