I was reading about the silk road and its role on the spread of Islam, but I am not quite sure as to why Islam didn't spread into China like in other places.
What precisely do you mean by "spread"? Or, for that matter, "China?"
If you mean "why aren't there many Muslims in China", well actually there are millions of them. About 21 million in fact (according to the Chinese department of religious affairs, who may under-report the number of Muslims, though their statistics on Muslims are probably more accurate than their statistics on some other religions). Of course, if you mean "why didn't Islam become the dominant religion in China" then that's a bit more complex.