Popularized by the 1858 song "The Yellow Rose of Texas," the phrase romanticized death as a journey to a promised land. Used during the Civil War to soften news of casualties, possibly linked to the Battle of San Jacinto (1836) where many Mexican soldiers perished.
In the 1800s, Texas was a magnet for debtors, fugitives, and opportunity-seekers. People who vanished—whether dead or simply relocated—were said to have "gone to Texas."
Today it's often used humorously or lightly to mean "deceased" (similar to "pushing up daisies"). Shortened forms include "gone Texas." Generally not offensive, but context matters.