Why did Texas have to give up a lot of land to become a state?

Texas was then a country and had debts. The United States paid the debts if Texas ceeded lands in dispute with other territories.