Injustices in this world happen all the time, even on very small scales. I don't know their perspective so I can't say for certain why they did what they did. And I would have to know that because in truth, there is more to every picture than just the brush strokes that one person gives. I am not saying you are not telling the truth- not at all. I am saying I cannot call it because I don’t have all the facts.
A co-worker of mine was fired on the spot several months ago and I took issue with it (in my heart) because I thought it was ridiculously unfair. But I did not have all the facts. Later on, I found out that there were a number of reasons she was fired and not just because of what she did that day. And actually, she caused herself to be fired. Again, not saying that about you. You may have suffered an injustice to be sure and if so, it happens all the time. For that, I am very sorry.
EDIT: If he tried to get you to do something illegal and you balked, refusing, then likely, the "mistake" you made is just a pretext for firing you.