We can never know the answer to this for certain. However, one major theory is that of Jared Diamond who, in Guns, Germs, and Steel, proposes that China fell behind in science and technology because it had no competition for power in its region.
China was dominant in East Asia. Therefore, it did not have to worry about taking every advantage that it could to get ahead or stay ahead. This meant that it could reject science without harming its position.
By contrast, European countries were all locked in fierce competition. They had to do everything they could to get ahead. No country could reject science. Once scientific advances began, all countries had to pursue them lest they be left behind. For this reason, the Scientific Revolution arose in Europe and not China.