I said the n word and got sent to the principal's office
What made you think that it was okay to use the N word here?
I don't know why I said it.  It just rolled off of my tongue.
It's wrong to use racial slurs in any context, because they are offensive to so many people.  Regardless of your intentions, the school was right to address this incident in the way that they did, and you should take responsibility for what happened.
The principle is being too much of a hard ass. I should have known better.
You should have known better is right. I think that it is never the right time to use racial slurs. They are so hurtful to the race that they are aimed against.