Because Trump doesn't care about long term consequence of his actions, he only care about short-term. He nly care about what would be good for his business and what would make him look god, mostly to his base. If you'd tal to Trum pabout some policy that wouldn't make him look very good right now but would have very good effects on the US by 2022, he would laugh at you.
Putin know he will be around for a very long time. He's current mandate goes until 2024. Then he won't have the right to be candidate to the next russian presidential election but the situation, was the same in 2008 and we know how he got around this : his prime minister ran for President, was elected and picked Putin for Prime Minister. Officially, Medvedev was the president and Putin was his prime minister. In reality, Putin the roles were reversed. So he doesn't care f something could be bad for him on short term, if it's good o long term, he goes for it.
Also russians love Putin, he did actually improved russian economy (although it's still pretty weak, aside from a bunch of very rich oligarchs, russiand are quite poor). Anf he made them proud of their country, like they were when the Soviet Union was a super-power. Russia is respected on the diplomatic field, as it was before the collapse of the soviet union, before Mikhail Gorbatchev and Boris Eltsine. Putin's approval in Russia is, at least, 70% so hes doesn't havve to worry about anything that coul cause him his re-election.
And, as a former KGB/FSB executive, Putin is very good at manipulating people and Trump' psychology is not very complicated, Putin knows exactly what he can't from Trump, what he can and ho to bring Trump do deliver him what he wants