The short answer is simply that (a) they claimed to be the legitimate government of all China, and that they should control all of China, and (b) they could.
Not controlling Xinjiang would have left them with a largely KMT-controlled neighbour to their west, which looks like a politically unacceptable choice given the alternative of a relatively easy takeover.
More generally, the Republic of China had been working to restore China's borders to those of the late Qing, including the re-incorporation of breakaway regions such as Tibet and Mongolia, and, of course, Xinjiang. Unlike the ROC, the PRC recognised Mongolian independence in 1949 - not because they wanted an independent Mongolia, but because of Soviet protection of Mongolia. The Soviet Union didn't offer the same support for an independent Xinjiang vs incorporation in the PRC, so most of the leadership of Xinjiang accepted becoming part of the PRC. Tibet, which didn't have such Soviet support, was invaded and forcibly returned to Chinese rule (something which the ROC had been intending to do). Taiwan escaped, thanks to US protection.
The Soviet Union did have a foothold in Xinjiang, thanks to the Soviet-supported East Turkestan Republic. But this was only a small part of Xinjiang, and Stalin was willing to abandon them to Chinese rule. The Soviet Union provided logistic support for the CCP invasion, supplying transport aircraft, fuel, and food - they played an active role, supporting the CCP and pressuring local leaders to cooperate with the CCP.
Soviet aid to the CCP for the takeover of Xinjiang probably made Mongolian independence more acceptable. Stalin had pushed for Mongolian independence at Yalta, and the USA and UK agreed. (China was not a participant at Yalta - they would not have agreed, and refused to recognise Mongolian independence for a long time afterwards. These days, they've given up their claims, recognising Mongolia as an independent nation in 2002 (although the official borders of the ROC still include it).)