Having tried to engage with a number of Trump supporters who do this, I am convinced that this tactic is utterly disingenuous. Still, I think it's instructive to examine it. What are these folks trying to accomplish when they do this? I think a few things are going on, and I want to talk about why they are all bullshit.
Trying to appear as if they are calling for justice
On the surface, most of these attempts take the form of a call for overdue justice. For example, when it comes out that Donald Trump shared classified information with the Russian Ambassador and someone demands that he be held accountable, the inevitable response is "but Hillary Clinton was never held accountable for her private email server!" The implication here is that whatever Donald Trump has done, it is a far greater miscarriage of justice that Hillary's email indiscretions went unpunished. An occasional variant of this goes "We know Hillary did something improper with having the private email server whereas the allegations against Trump haven't been proven, yet you're all concerned with nailing Trump while giving Hillary a free pass."
Why this is bullshit: Someone who is truly concerned with the mishandling of classified information should, of course, be concerned both about what Hillary Clinton did and what Trump is alleged to have done. Since it's not as if there's a finite amount of justice to go around, it's possible to think Hillary should be held accountable and that we should investigate credible allegations of the same behavior involving Trump and hold him accountable if they turn out to be substantiated.
If you want to present yourself as a true and consistent champion of justice, you need to demonstrate that you want to see the underlying principle applied in all cases. But of course the Trump supporter never does this. It's always "but Hillary Clinton..." and then a blank out. No mention of what should be done about Trump's indiscretion, and certainly no suggestion that the same principle should be applied in his case.
Even if the Trump supporter is willing to concede that Trump should be held accountable, the level of concern never rises to Hillary email level (or Bill Clinton doing inappropriate things with a cigar tube level). As I've argued elsewhere, this way of thinking is ridiculous. Regardless of how egregious you think Hillary's actions were in the email case, she is not the current President. In fact, she holds no office whatsoever. If Trump is doing something similarly bad -- or even, I would argue, something considerably less bad -- it's appropriate to be much more concerned about his behavior right now, since he is the current President and is thus in a position to potentially harm the country through his active misdeeds. In fact, by identifying and addressing Trump's misdeeds now, we may be able to prevent damage to our country, rather than having to resort, at best, to retrospective justice (as was our only option in the Clinton email case). It seems to me that someone who was genuinely concerned with the country's well being would be all forr that.
Accusing liberals of hypocrisy
This usually takes the form of "Look at how the media / Democrats / the person I'm talking to is all over Donald Trump but gave a free pass to Hillary / Obama / whoever over the similar thing they did. What a bunch of hypocrites!"
Why this is bullshit: Even if the target of this attack is guilty of hypocrisy, the Trump supporter raising the issue entails two significant admissions that undermine his own position. First, because it asserts that the target should have been concerned with the thing that Hillary or whoever did, it means that we ought to be concerned about the essentially similar thing Trump is doing now. Thus, the Trump supporter is conceding the premise that what Donald Trump is alleged to be doing (if true) is cause for concern. Secondly, because the Trump supporter then doesn't go on to demand that Trump be treated the way he believes Hillary (or whoever) should have been treated (see above), he opens himself up to the same charge of hypocrisy he is trying to level against his target.
To obfuscate and distract
Most of the Trump supporters I talk to aren't dumb, so I think they grasp the incoherence of their approach on some level. However, just bringing up Hillary has the effect of changing the subject to something other than the misdeeds of the person they support. As Trump himself has demonstrated, obfuscation and distraction are effective weapons, and Trump supporters like nothing more than to rail against their favorite liberal targets anyway. This tactic is also especially effective against well-meaning interlocutors who assume the Trump supporter is approaching the conversation with the same good faith as they are and attempt to answer the Trumpy's charges against Hillary point-by-point, allowing the Trump supporter to succeed in changing the subject.
Why this is bullshit: It's senseless to argue with someone who isn't approaching the conversation in good faith, and these tactics are prime examples of bad faith. Once it becomes apparent that the Trump supporter has resorted to them, he exposes himself as a partisan sheep who doesn't bring anything to the table intellectually.
To garner sympathy
The Trump supporters often fall into this mode among themselves, but sometimes it bleeds out into discussion with people who don't share their viewpoint. The refrain goes like this "The media / Democrats / whoever are out to get Donald Trump. They never went after Hillary like this. The deck is totally stacked against him. See, unless you're part of the liberal establishment, you can't get a fair shake. Woe is us!"
Why this is bullshit: Even if the media went easy on Hillary, the appropriate response to their going tough on Trump for similar (or worse) misdeeds is thanks (perhaps with a small dose of 'what took you so long?'). But more insidious is the notion that Trump -- and particularly his supporters -- are deserving of sympathy. Trump supporters championed and voted for a man who is, obviously and transparently, the least qualified, most despicable, most pro-authoritarian person ever to hold the office of President. Far from being victimized by those of us who refuse to tolerate this unacceptable state of affairs, Trump's supporters deserve to be held accountable for being complicit in it. A Trump supporter asserting that we, as decent, concerned citizens, are somehow in the wrong for calling the president to task for, e.g., sharing classified material when they themselves participated in enabling him to do so is obscene.
Regardless of the motive, bringing up Hillary Clinton is an attempt by the Trump supporter to switch the topic to one where he believes he holds the moral high ground. But, as noted above, one can only claim to hold such a position if one wants to see the underlying moral principle applied equally and universally. If you don't, it amounts to an admission that you don't believe there is any moral high ground (or principle) at all: just partisanship and allegiance to whatever team you're on. I don't think that's true, and I don't think someone who thinks that deserves to be let off the hook. In the future, my standard response to the 'But Hillary Clinton...' arguments is going to be as follows:
"This isn't about Hillary Clinton. This is about the conduct of the person you put in the White House and continue to support. What he's doing isn't OK, and neither is your supporting someone who does it."