Since it makes them happy
The key victory of the Mexican war is when Winfield Scott went through Mexico and captured Mexico city.
They served with the Confederacy because they believed that the Confederacy fought the big central government that was being imposed by the Union and they wanted to fight this so as to keep sovereignty over their own land. They believed that the Union government didn't care about them while the Confederacy would give them room to breathe.
Well first Spain sunk a battleship Maine in Havana harbor which caused the US to get involved and the US's role was to patrol coastal waters to prevent gun running.