Putin is very smart and he understands the politics of USA. He knows very well that he can't trust the US so he's keeping his enemy closer. And Trump understands that since he's beefing with everyone he can't afford to be on the wrong side of Russia at the moment.