Failing in the right direction
Did Ezra sin by ordering the men of Israel to divorce their pagan wives in Ezra 10? Was he doing the will of God? Did he pick the best from two very bad choices?
To really understand what happened, the context is important. The nation of Israel had been sacked, destroyed and scattered by the evil Assyrian Empire as God's judgment for their idolatry, which included burning their own children to death in sacrifice to demons. The kingdom of Judah was spared for a while, but was eventually judged in the same manner by the Babylonian Empire for the same demon worship that doomed Israel.
So now, after decades in captivity, Judah is returning to the Promised Land to rebuild Jerusalem generally as well as the temple of God. Ezra discovers that the Jews are back to the same demon worship that caused the nation to be destroyed in the first place, and he is apoplectic. He is overcome with grief, anger, and fear over what is being done. He knows that even the great king Solomon was enticed to worship demons by his pagan wives, which is what led to Israel being split in half in the first place. So he comes up with a solution: The marriages would be dissolved.
Now, here is the problem. The Bible does not allow for divorce unless one of the partners has committed adultery. In the absence of serious sexual sin, the marriage may not be dissolved. What is especially relevant here is that the Holy Spirit inspired the Apostle Paul to write that if an unbelieving spouse is content to stay with his Christian wife or her Christian husband, that the Christian should stay in the marriage. If the unbeliever leaves, however, the Christian is not bound. One can imagine that the majority of pagan women in Ezra's time were content to stay with their husbands.
Given the context of the New Testament, I believe that Ezra sinned. I was told many times in my youth that "it is never right to do wrong in order to get a chance to do right." I believe that applies here. The Bible is not clear about whether Ezra was right or wrong in that book, though, and Christians of good faith disagree on this. The context of demon worship and the fact that the mixed marriages were the cause of demon worship is incredibly important in discerning whether Ezra sinned.
Therefore, the worst thing that can be said about Ezra is that he was failing in the right direction. He was desperate to eliminate demon worship and knew the wrath of God could fall on the weak, rebuilding nation of Judah for that demon worship. If the marriages continued, demon worship would continue. (Obviously, God had the power to change the hearts of the men of Judah to eliminate this idolatry, so one could argue that Ezra acted from a lack of faith.) Given two very bad choices, Ezra chose the less bad option.