Deuteronomy 21:15-17
"If a man have two wives…" The text doesn't say that the man is an adulterer or that he must put one of his wives away. In fact, this commandment would be nonsensical if God had completely forbidden polygyny. Marrying two women might be foolish in almost every circumstance, but it's not a sin or else the following rules about the children of forbidden unions would make this law completely unnecessary.
Favoritism breeds jealousy and bitterness, which become the seeds of even greater destruction. To a certain extent, favoritism is inevitable. Parents have favorite children, children have favorite parents, and a polygynous man is almost certain to have a favorite wife. It's just human nature. That in itself wouldn't be a serious problem except it usually becomes the basis of sin, neglect, or abuse. The firstborn son of a free wife must be considered the firstborn of his father, regardless of how the man feels about that son's mother.
We are prone to poor decisions based on emotion rather than reason and spiritual insight. Torah moderates our weaknesses. If we follow God's laws no matter how we might feel, we are very unlikely to go wrong.