Let me make your question even stronger: The Talmud says that Esther was already married ... to Mordechai! With that in mind, Esther's "marriage" to Achashverosh seems to be an even worse sin than intermarriage.
The answer is that Esther did not marry Achashverosh willingly, she was forced into it. So she is blameless in that regard. Even when she went willingly, since the salvation of the entire Jewish People depended on this, it was permitted.
But your second question is, why did the Jewish People benefit from this mismatch? Why did God allow the redemption of the Jews to sprout from Esther's ignominious "marriage" to a drunken, idol-worshipping king?
I think the answer is as follows: The main theme of Purim is that even when we Jews are in exile, God directs every aspect of history for our ultimate benefit. Even seemingly bad events further God's hidden plan to bring the final redemption.
- Esther 2:8
- Targum Ibid.
- Even Haezer 178, Beit Shmuel, Chochmat Shlomo