An interesting question comes up when we consider the role of Mordecai in the Purim story. Was Mordecai inviting trouble by refusing to show respect to Haman? After all, it was his refusal to show the vizier honor that led to the attempted genocide of the Jewish community in Persia. How can we justify his actions given the great risks that were involved?
One midrash (Yalkut Shimoni) states that Mordecai was actually engaged in a religious dispute with the judges of Israel. In Esther 3:3 it is written, "and the king's servants (i.e., the Jewish religious authorities) said to him, 'why do you violate the king's orders?" In other words, the rabbinical judges were questioning why Mordecai was engaging in civil disobedience. After all, Jewish law does not forbid bowing to a king, and even the great patriarch Jacob bowed to Esau seven times (Gen. 33:3), so why should Mordecai refuse to submit to the King's right-hand man? This question became pressing since Mordecai's repeated refusals caused Haman to begin plotting against the Jews. So why create a problem, Mordecai? Just submit to the civil authorities "as unto the Lord."
The midrash Esther Rabbah defends Mordecai by stating that Haman emblazoned the image of an idol on his clothes, and anyone who bowed to him would thereby be bowing to his idol. Since idol worship is explicitly forbidden (even at the expense of one's life), Mordecai righteously refused to comply -- and hence his civil disobedience. Other sages (such as Rashi) say that Haman actually regarded himself a "god" -- not unlike some other egomaniacs of human political history -- and therefore bowing before him amounted to the same sin of avodah zarah (idol worship).
Still other sages say that Mordecai considered Haman a slave, since he was a descendant of Amalek, and therefore it was unfitting for him to bow down before him. In the midrash Esther Rabbah, a supposed dialog between Haman and Mordecai is recorded in which Haman claims that Mordecai owes him obeisance since Mordecai's ancestor Jacob had bowed down before his ancestor Esau (i.e., Esau was the grandfather of Amalek and ancestor of Haman). Mordecai, according to this Midrash, responded that while that may be true, he was from the tribe of Benjamin, and his ancestor Benjamin was not alive at the time of the Jacob-Esau encounter -- and therefore did not bow to Esau. Even so, some of the sages wonder whether Mordecai's pride warranted putting the Jewish community at risk, especially since Jacob himself had "swallowed his pride" by bowing before Esau for the sake of a greater peace (Gen. 33:3).
Most Jewish commentators consider Mordecai's resistance to assimilation as being the chief factor behind his acts of civil disobedience. The Talmud (Megillah 12a) states that the Jews were growing increasingly content with their lives in exile and no longer yearned to return to the Promised Land of Zion. Mordecai's actions were therefore those of a prophet calling the Jews to remember their true identity.