How can we explain Exodus 32, where the Levites put thousands of Israelite idolaters to the sword? This passage makes me stumble.

Here are a few of my observations about the Levites and the sword:

1. Simeon and Levi took revenge in Genesis 34 (the Dinah affair). This was going beyond the command of God.
2. The Levites rallied to Moses' cause -- the one true God (Exodus 32). Aaron may have been stalling for time, but then he may have been realistic, knowing that he did not have the moral power or talent to prevent what was happening. Despite his complicity, he was not killed by the avengers. Maybe his guilt is less than we tend to think (?).
3. Phinehas (Numbers 25) was also a Levite. This man defines zeal. (See Phinehas O.T. Character podcast.)
4. Taking a strong stand for the Lord – even to the point of violence – seems to be a family trait. Thus we see that the Levites were chosen to represent God (the priesthood) in part because of the strong stands they were willing to take.
5. One other interesting descendants of Levi is Ezra. Though not violent, he also seems to have had fiery-hot conviction.
6. In Exodus 32, technically all the idolaters should have died. Relatively few paid the price. Idolatry no longer requires execution, though it is still a serious sin.
7. Sin has consequences. Only God has the right to take life, as only God gives life in the first place. There is no precedent here for modern Christians, except the dramatic picture of our need to take a hard stand against sin. Real zeal, after all, is throwing ourselves with abandon into God's cause.