Well, sorry this happened to you first off, but realize that sometimes in life you can DO NOTHING WRONG and STILL GET THE SHAFT. Sorry to say but that's just LIFE. Also sorry to tell you that this is gonna happen to you more than enough times in the future if you live long enough, and so don't get TOO upset about it.
Realize that teachers are people too, and some teachers are A-holes. Just part of life. Part of the reason I'm generally convinced most people suck... not all, but certainly more than a few...
I give people the benefit of the doubt, and sometimes I'm pleasantly surprised to find that folks are good and decent. Many times my suspicions of their status as A-holes are confirmed... As they say, "cest la vis"... (such is life).
Even if the teacher isn't a particularly petty person, realize too that they have bad days... sometimes they're catching crap rolling downhill from upstairs, just like yall do as kids from grumpy or stressed teachers or other grown-ups. It happens. My wife, sister, and Brother in Law are all teachers, and I can tell you they have a LOT more stress now than EVER... Heck I was a bus driver and we got plenty of crap coming down from upstairs that made no sense, would have teachers outright lie, (and their word was ALWAYS considered gospel truth no matter HOW BIG A LIE it might be, because *they* are "professional employees" whereas we were merely "support personnel"... so if in doubt, blame the bus driver... Again, just one of those things that makes life suck sometimes... what can you do??) Maybe she was stressed about some crap paperwork she has to get done on 80 students and have it turned in by tomorrow morning or something... believe me there's plenty of that. Maybe she just snapped because of stress and the kids getting loud and rambunctious and took it out on everybody, and then the sound set her off again... and yall happened to be the unfortunate recipients of it...
When I drove bus, there was more than a few times that I simply pulled over to the side of the road and parked... yelled out "when yall decide to SHUT UP we'll continue... otherwise we'll sit here til yall settle down and I can hear myself think to drive safely." I myself was never a fan of corporate (group) punishments like that, because it's always the quiet, good kids that suffer because most of their classmates are immature, idiotic turds. BUT, sometimes as an authority figure, you just don't have any other choice, and it's whatever works at the time that you use... use the tools you got, so to speak... At any rate, I'm not saying that she was right (teacher) but I'm just saying, "hey, it happens". I always made a good faith effort that when I called someone out personally for doing something, that I had the right one. Nothing PO'd me as a driver more than SEEING WITH MY OWN EYES some particular kid do something stupid and calling them on it, and them saying to me, "I didn't do that-- you didn't see that." In effect, it was calling me a liar to my own face, because I made a good effort to make sure I had the right one before I called them on it. I didn't act (or certainly tried my level best) not to be capricious in my rule enforcement. Some folks aren't so diligent and don't expend as much effort to "get the right one". And, sometimes I, like everybody else including this teacher of yours, makes a MISTAKE... there was a time or two that I called someone out that I was "pretty sure" did something, only to find out they didn't, and I was man enough to apologize to them for it and make it right. Some folks (including teachers) aren't responsible enough or honorable enough to admit that they're wrong or mistaken and rectify the situation. Again, just how some folks manage to suck...
Don't sweat it. It's better to be accused incorrectly or falsely and be innocent than to be guilty and get away with something, though it certainly never seems that way. Since you're going to Catholic school, I'm sure you've learned by now how Jesus himself suffered and was executed even though he did nothing wrong. A detention, while an inconvenience and perhaps a personal embarrassment to you, is certainly not the worst thing that can ever happen to you... so don't let it get you down too much. I lost my job because of a mother who thought her precious little daughter walked on water, despite me having to constantly remind her to sit down on the bus, not pick on other kids, and not yell and talk loudly on the bus, and not constantly come up and distract me from my driving. I wrote her up to the principal several times, which after about 3-4 should have put her off the bus for awhile, but the limp-wristed principal was too lazy to do anything about it, and this mother was the type that if the kid crapped on her dinner plate she'd think it was cute and smile and pat her on the head... so NATURALLY *I* was just "out to get" her poor, innocent baby!!! Nevermind that her teacher was constantly writing her up as well... Never underestimate 1) the stupidity of people, and 2) that most people, especially higher-ups, are generally just like lightning-- they ALWAYS FOLLOW THE PATH OF LEAST RESISTANCE! IOW, for my turd of a boss and the principal in question, it was easier to simply fire me and replace me with a driver that just let kids scream and push and shove each other, steal from each other, beat each other up, and hang out the windows til somebody gets killed rather than stand up and put this one grossly deluded mother in her place... Oh well, that's life...
Don't worry... one stupid detention isn't going to ruin your future... it'll be okay... blow it off and be done with it. I taught my daughter that in school, LOTS of stupid stuff would happen... and unlike my parents, who basically taught me to put up with ANYTHING, I taught Keira that when she has a problem, take it to the teacher, and if the teacher doesn't fix it and she's had a few times to make it right, take it to the principal, and if THEY won't do anything, solve the problem herself. I was picked on and bullied terribly when I was in school, and I don't want Keira to endure that sort of thing just to "stay out of trouble". I told her that if the teacher turns a blind eye and the principal won't fix the problem, then if she has to fight to DEFEND HERSELF, strike AS HARD AS POSSIBLE, as FAST AS POSSIBLE, and DON'T STOP TIL THE OTHER ONE GIVES UP!
Yeah, it'll mean she gets in trouble, gets suspended or ISS or whatever, but so what... it's a couple days or so of punishment, which I can speak from experience is better than 12 years of living h3ll....
Later and good luck to you young man!!! You sound like an honorable and upright guy, and we need more of yall!
Take it easy and good luck! OL JR
PS. By all means, protest it and have a hearing with your building AP or principal... explain your side of the story, point out your clear record, and explain the situation calmly and succinctly, and why you think you don't deserve to be punished like this... explain you understand that perhaps the teacher was upset or had a bad day, but it's your belief that she mistakenly took this out on you and your "accomplice" (friend doesn't sound like the right word from what you said). If the principal is understanding and fair and honest, then they'll probably let you go with a warning or a lunch detention or whatever... If not, take heart... God knows the heart, who's guilty and who's not... and he keeps track when folks suffer unjustly... don't let it steal your joy, and serve your punishment with a smile. Apologize to the teacher afterwards for upsetting her, and realize that as the Bible says, "love those who persecute you, pray for those who despitefully use you, for in so doing you heap piles of BURNING COALS ON THEIR HEAD". IOW, God repays...
Later and good luck!