It’s dangerous to take the position that “the ends justify the means”, regardless of your political beliefs, because it undermines the norms and institutions that form the basis of a healthy and robust state.
Let’s put the shoe on the other foot, and remove it somewhat from today’s emotionally-charged environment. Let’s say John Kerry (or someone affiliated with him) met with China in 2004 and told them, “Hey, I could really use some help beating Bush in the upcoming election. If you can do anything to make sure that happens, we’ll do you a solid when our administration takes over.” Surely you’d be outraged if Kerry were to have edged out Bush and granted China political considerations after getting inaugurated, even if nobody could find any conclusive evidence of China actually successfully influencing the election. Yet a Democrat taking your stance would consider him a hero for doing what was necessary to prevent Bush from winning the election, rather than someone who colluded with a rival state for personal gain.
The laws are in place for a reason, and the long-term harm to the United States of eroding faith in its political system isn’t worth flipping one election towards a candidate who happens to be to your liking.