The reason Trump did what he did - and is doing w/re "denouncing" Russia - has exactly zero to do with anything except trying to disprove that he colluded.colludes with Russia and upping his popularity ratings. Period. 
He's too stupid to understand that there are entirely foreseeable possible consequences of his self-absorbed, reckless decisions.