This post dives into it a bit: https://www.lesswrong.com/posts/34XxbRFe54FycoCDw/the-bottom...
Just because an argument comes from motivated reasoning doesn't necessarily mean it's wrong, but I think it's more likely to be wrong (and it's also likely to be framed in a misleading way or ignoring good contradictory examples). It's also hard to discuss things with the person to learn what's true because they're often not arguing in good faith.
I think this is actually a reason people are often skeptical of debate (since a clever arguer can argue a wrong position and win against someone who is right, but not as good at manipulating rhetorical devices). Also why lawyers can have a bad reputation. People can know something is wrong, but may themselves be bad at articulating why. Other people that are wrong may be good at making themselves seem right. The smarter the person is the more they can effectively rationalize bullshit.
A good example of this is Ben Shapiro and a lot of his arguments (particularly the ones I've seen around religion/abortion) are mostly motivated reasoning nonsense.
That said, while this may be true on an individual level debate should still be true at scale (the best argument from one side should still be pitted against the best argument from another). I think this is what free society and liberal democracy is all about.
I often prefer dialogue to debate—a conversation of cooperative learning instead of competitive proving.
The main idea is a clever arguer can start with any conclusion and then retroactively select the points that support their conclusion while ignoring any evidence or points that contradict it. If you do this then the points you bring up don't inform much because you've already decided the conclusion based on something else (in the example it's whoever paid the most for their arguments).
It's better to start with trying to understand things and then using what you learn to inform a conclusion.
However, to your point, I find myself doing that sometimes without even realizing it and I wonder what drives it internally and externally.