The U.S. took half of Mexico's territory why didn't they try and take all of it?
To take all of Mexico would have been to incorporate a vast amount of people into the US who were of a completely different nationality, who spoke a different language and had a distinct culture from that of America (if course, even within the US there were cultural differences, especially during the 1850s). How would the US incorporate Mexico into the Union? Would Mexico be partitioned into several states and given equal rights to those of the preexisting states? If so, that would lead to a dramatic shift in power in Congress. The Union would be effectively co-opting an entire nation into itself, something that would have huge ramifications. Just to take one example, Mexico had abolished slavery before the Mexican-American War, so if that law remained in effect and Mexico was split into states that and incorporated into the Union, anti-slavery states would dramatically outnumber slave states, something that the politicians of the South would not be too keen on. The US could go the alternative route of not giving Mexico's people the same rights as the residents of US states or territories, but even the most expansionist politicians in the US at the time would probably frown upon such policy, considering that that would be a pretty glaring example of Empire-building. It would also be dramatically expensive, to say the least.
The Mexican-American War was never about taking all of Mexico, because taking all of Mexico would have caused significant upheaval to the United States.