I taught art in Jr. Hi for 32 years. We had many student art shows, but never would I have sold a student’s art without permission. I suggest you go to the teacher to make sure this really happened. Express your feelings and say you are not happy with your piece being sold. Be nice and not angry. You will get better results that way.
Are you sure there was not an understanding that artwork would be for sale at this show? Surely you should receive the money from the sale.
If your painting was sold, and there is nothing more you can do about it, take solace that selling a painting is a compliment to your artistic efforts! Many artists never sell anything! So keep painting/creating and enjoy the process! You have many more masterpieces to create. And learn from the experience for future shows.