Polk ordered American troops to occupy what was, at the least, disputed territory, then claimed that Mexico had invaded the US when it attacked these troops.
The battle at the Alamo took place during the Texas War of Independence, quite some time prior to the Mexican-American War.
The politicians in power in both countries were spoiling for a fight, largely for internal political reasons. They got one.
Of course Polk also sent the troops into the disputed teritory without Congressional Authorization. Polk of course knew it would provoke a fight. It raises a question of Presidential War Powers. Can the President intentionally provoke a war without Congress' consent?
It was hardly a war for all the space in history it's gotten. A seige and a skirmish. OK, maybe San Jacinto rose to the level of a battle. But it wasn't much of a war from either perspective.