Mexico never recognized Texas's independence from 1836, and always considered it their sovereign territory.
The United States chose to annex Texas after various negotiations (initially secret) during the Tyler Administration. (The annexation of Texas didn't even properly specify the actual borders of the territory being claimed!)
When we annexed Texas, Mexico — having warned Secretary of State Abel Upshur multiple times previously that annexation would result in a declaration of war — followed through.
Any detached viewer of military history can see that Mexico's casus belli was justifiable.
So you would have opposed the war. You sound like a Whig. It was firmly the position of the Jacksonians that America needed to expand across the Continent. So wanted to take over Mexico as well ,though it was decided that that was too far. ( Although it might have been a good idea, seeing that Mexico is facilitating the invasion of the US)
Santa Anna lost the battle of San Jacinto and signed the treaty. Decided to change his mind and start a war nine years later.
The Texas rebellion was concurrent with a greater Mexican rebellion against Santa Anna when he repealed the Mexican constitution.
He was a stupid despot and it was chiefly his own naked aggression that caused him to lose the entire North American southwest.
Any detached viewer of military history can see that Santa Anna was a walking casus belli for everyone around him