Basically, your sacrifice was too small. The situation was something like this:
Lawful god is happy.
Neutral god is pissed.
Altar is neutral.
You are lawful.
When you sac on an altar, if the sacrifice is small, it usually goes to the god who owns the altar--in this case, the neutral god. Since he was pissed at you, you got your gear dusted. If the sacrifice was large enough, you would have converted the altar. Intermediate sized sacrifices might go to either god, so you might weaken the altar and strengthen the lawful god, or weaken your lawful piety and strengthen the neutral god. This latter situation is risky, since if two gods both have a stake in the altar, there's a good chance at least one of them is pissed at you.
tl;dr: Generally, you should not sacrifice at altars that are not your alignment unless you are intending to convert them (in which case, the sacrifice should be very large), or convert your alignment (in which case, the sacrifice should be 1 gold).