Using the scientific method, we can prove a hypothesis by testing and collecting evidence from observation and experimentation. This is probably the same process you apply when deciding if something is right or wrong as long as you are logical.
This is especially useful when you're in an argument. By arming yourself with an arsenal of armor-piercing evidences and heat-seeking proofs, you can annihilate their counter-arguments with ease. In time, you'll get the illusion that you are always right.
I admit that I like to argue on everything and anything or rather I like winning them. If you try hard enough, almost any piece of information can be used to your advantage. This sadly, isn't that I'm particularly smart or anything but rather it's just confirmation bias at work.
We have a tendency to prefer information that support our views. This led us to prove our hypotheses in a one-sided way, ignoring other alternatives. It is especially common if you have an emotional attachment to the issue. Now you know why it's so hard to convince someone that's passionate about something that he/she is wrong.
I do not know of a solution to this except to be aware of it and try very hard to not let it bite you in the ass. Just remember that you are not always right.