Genetic fallacy
The genetic fallacy is when you judge an idea or claim only by where it came from—who said it, what group thought of it, or how it was invented—instead of by the reasons and evidence for it. Origin alone doesn't make a claim true or false. A bad person can say something true; a good cause can be supported by bad arguments; a policy from a party you dislike might still be good. The fallacy is to dismiss or accept a claim on the basis of its source rather than its content.
Examples
We should reject that policy because it was first proposed by that party.
He's a corporate lobbyist, so his argument doesn't count.
That idea came from the old regime, so we can't use it.