At the time, Utah was located in Mexican territory.
(BTW, the canyon by which they entered the Salt Lake Valley is Emigration Canyon. Emigration is when you leave, immigration is when you arrive. They were consciously leaving the US. They weren't really "going to Mexico", though; they were intending to form their own independent country. But a year later, the US annexed the area.)