Not there was anything wrong with the Mexican War....
There were two immediate causes of the Mexican War--the dispute over the boundary between Texas and Mexico, and the Mexican government's refusal to sell California to the US. If the US had waited, we would have gotten California pretty soon anyway as a result of the Gold Rush...no way would Mexico have managed to hold on to California once there were a couple of hundred thousand Americans there.
Without the Mexican War, there might not have been a US Civil War, and without that, the abolition of slavery might have been long delayed...so Polk's decision to go to war with Mexico hastened the end of slavery.