China is just doing good business and making money. They know Israel and the US will never allow Iran to complete their nuclear weapons development project. You'll never see a successful nuclear test by Iran, and China & Russia know that.
I overstated that a little by using the word "never." I think in the view of China and Russia, it's extremely unlikely but not impossible that Israel and the US would allow Iran to complete their development of nuclear weapons. In their view, it would be something like a 2% probability that this could happen. For whatever reasons, they're willing to take the small chance that they could actually put nukes into the hands of Iran. I'm not sure why they would do this, but perhaps it's because the leaders of China and Russia are just accustomed to living a more insecure, risky life than we have here in America. There are far fewer safeguards of human rights in those countries and a long history of wars and massive destruction on their soil.
Perhaps they just believe unlikely but serious risks are a part of life and it's worth taking them to make profits and make an alliance with Iran. I've met a few Russians in my lifetime and they all seemed to be courageous, tough-guy, risk takers. Their view seemed to be that men who don't gamble and take some serious risk once in a while are cowards.