Well, since Trump couldn't get the sanctions lifted against Russia, I guess he thought that Putin should get SOMETHING for helping him win the election.
Warning of an attack? Good, but not as good as lifting the sanctions.
It's called saving innocent lives. Or doesn't that matter?