Based on a Naaleh.com shiur by Rabbi Hershel Reichman
At the time of the giving of the Torah, the Jewish people rose to the level of Adam before the sin. How did they fall so quickly after that with cheit haegel (the sin of the golden calf)? The commentators explain that their intentions were not evil. They thought Moshe had died and that they had been left alone in the desert. Perhaps they reasoned that it was a question of life and death and that they could suspend Torah law to create an intermediary that would connect them with Hashem.
Shem Mishmuel points out that often people will sin with good motives, and that good intentions are never lost. Hashem takes them, purifies them and adds them to the sinner’s credit. We see this with the story of the Korach rebellion. Hashem commanded Moshe to take the 250 fire pans that had been used for sin and fashion them into an iron plate to cover the altar. The 250 people desired to come closer to Hashem through the position of the kehuna gedola (high priest). They had a noble goal but their actions were wrong. They were punished, but the vessels they used were consecrated for the holy mishkan.
The Torah teaches that actions are more important than intentions. The ends do not justify the means. Whether one achieves one’s goal or not doesn’t matter so much, but the way we do it must be right. Nevertheless good intentions still count. Moshe burned the calf and mixed the ashes with water and had the Jews drink it. His intent was to destroy the Jews’ evil deeds and retain their initial pure thoughts which had been to serve Hashem. Their good intentions were captured in the water and it saved them when they drank the potion. Those who were true sinners died.
Other religions downplay actions and upgrade intentions. Judaism teaches the opposite. Evil actions bear consequences. Yet if one’s intentions are noble they are not lost.