The difference between these cases is that Mr. Yagan donated to a Congressperson's election fund, while Mr. Eich gave directly to supporters of a cause many find abhorrent. The degree of separation is important: although Rep. Cannon was anti-gay-marriage, we don't know whether that was the motivating factor for Mr. Yagan's donation. It could have been for some other reason: perhaps Mr. Cannon helped him or his compan…
I would be hard-pressed to think of a way in which donation to a staunch anti-personal-liberty candidate would be preferable to their electoral opposition. Usually, you see a Republican (like Cannon) up against a Democrat. Perhaps you could provide us with a scenario in which his opponent was so horrible that voting for Cannon was the lesser of two evils? Perhaps he was running against Senator Palpatine?
It also seems you are trying to dismiss the voting record with a stance that Politicians change their stances depending on how the wind blows. If so, perhaps you could explain why voting for someone whose vote is up for sale is any better than being a publicly anti-gay congressperson?