As my learned friend notes above, Texas became the twenty-eighth state of the United States in 1845. It's easy to learn this fact and simply see it as a logical extension of the spread of the United States across the North American continent, an almost natural process which requires no special explanation and is simply part of the fulfillment of Manifest Destiny; and this does indeed highlight one aspect of the truth. Americans certainly did not want to be competing with another white-dominated society for control of the North American continent; unlike Mexicans, Texans could - according to prevalent racial beliefs - compete with white Americans on their own terms, and they had their own expansionist aims. The U.S. had worked hard to liquidate its European rivals in North America, and it had no desire to see them replaced by Texans. This is all part of a familiar story.
But there were slightly more complex factors at play, as well. The fact Texas was a white republic and a slave-holding society complicated the situation, and introduced additional reasons for Americans to favour the annexation of Texas beyond the general push for expansion that marked American policy in this period.
Slavery was at the core of the matter. The issue was a divisive one in 1840s America, with southern planters ranged against radical northern abolitionists and everyone else straddling the line between. The issue had a practical as well as a moral dimension, with even those who considered slavery abhorrent and wished to end it worried about the consequences of doing so. If slavery were abolished and millions of blacks suddenly gained social, economic and political freedom, then popular opinion had it that the result would be a civil war pitting the races against each other as the bitter former slaves tried to seize by force the power that white society would surely not give up gladly. Northerners worried about a sudden influx of liberated slaves pushing down wages, while southerners saw their whole way of life threatened. All of this meant that even most abolitionists sought a way to end slavery gradually, avoiding sudden shocks to American society.
This was where Texas came in. It presented both a threat and an opportunity. The opportunity lay in its sparsely-populated territory and its location next to Mexico. One theory on the future of slavery held that the best way to ensure it died out gradually was to encourage it to become geographically dispersed across an ever-expanding amount of territory; the international slave trade itself had stopped by this point, so more territory available to slave-holders would not necessarily lead to a quantum leap in the total number of slaves, but instead would weaken the grip of the slave-owners. Texas potentially provided just such a territory for slave-holders in the American South to move into. Even better, slave-owners might move away from the states bordering non-slave states in the south and hence separate northerners from an institution they found abhorrent.
There was another reason that those opposed to slavery might see the annexation of slave-holding Texas as a good way to hasten the end of slavery in an acceptable manner. Being next to Mexico, Texas would provide a land route for freed slaves to migrate to Mexico and Latin America, which was thought to be a better solution for everyone as these lands were already occupied by coloured people and so blacks would be more able to integrate into society there. The climate was also thought to be more conducive to them. If you wanted to end slavery while minimizing the impact on American society, the annexation of Texas hence seemed to provide the best of both worlds.
And there was another reason why annexation seemed urgent in the 1840s. Seen from this angle, Texas played the role of threat, not opportunity. There were increased concerns throughout the United States that Texas would itself abolish slavery completely in exchange for a commercial treaty with the British. Such a sudden move was seen as having the potential to have a dramatic impact on American slaves, and possibly precipitate slave insurrections; it also seemed likely it would transform Texas into a socio-economic wasteland, much as had happened to Haiti after its slave revolt in 1793. It would not do to have a Haiti on America's southern border - a Haiti in the Caribbean had been bad enough, which is why the U.S. had sent money and arms to try and suppress the revolt there. To keep the Texans out of Britain's clutches, with this disastrous result soon to follow, it seemed best to embrace them.
So, to summarize, the annexation of Texas was supposed to accomplish three inter-related goals: to stop the Texans from freeing all their own slaves and entering into an alliance with the hated British; to encourage the dispersion of slavery across more territory, there to die; and to provide a route by which slaves could eventually escape towards the Equator, which was assumed to be much more to their tastes and certainly suited northerners who had no desire to see millions of black Africans upsetting their established order. Slavery would be vanquished and society preserved. If this delicate balancing act sounds fantastical, then that's because it was; as every student can tell you, it didn't quite work out that way.