That was Sam Houston, not Andrew Jackson. At the time, Texas was still a Republic and not part of the United States.
It was acting Texas president David G. Burnet released Santa Anna back to Mexico after the signing of the treaty (independence of Texas) that Mexico didn’t recognize. Santa Anna was no longer president and went into exile in the United States. Andrew Jackson released him back to Mexico in 1837, his last year as president. Regardless, 189 Texans died at the Alamo and Santa Anna had 342 Texan prisoners executed later the same month.