I'm not sure that's a completely accurate view.
https://en.m.wikipedia.org/wiki/Treaty_of_Guadalupe_Hidalgo
Mexicans in those annexed areas had the choice of relocating to within Mexico's new boundaries or receiving American citizenship with full civil rights. Over 90% chose to become U.S. citizens.