Polk wanted to annex Texas after the Texas Revolution. When Mexico said no we not only got Texas but New Mexico, Arizona and Kalifornia and beat the sh_t out of them all the way to Mexico City. Thus the Marine Hymn about the Halls of Montezuma.
Texas had some trepidation about joining the union as well.