Russia is a partner in SCO. If China wants to increase presence in Central Asia, Russia's home turf, it has to do that in a way somewhat agreeable to the Russians, if there is such a way. Ukraine support may be a trade-off in this regard, at least China may want to view it in this way.
Also Turkey and Iran are observers to SCO. In a way a replay of the Great Game 200 years ago, albeit with different players.