You have produced a class paper or a scholarly paper which you expect to get you a good grade and will be published, resp. For whatever reason the paper gets low grade, the solid journals seem uninterested in publishing the paper.
It does you little good to impugn the judgment of your instructor or the editor and referees of the journal, or the quality of the course. It does not help to find that they did not follow the rules, or were prejudiced against you (it may hurt them, but that won't get the article published, or your grade raised)--legally and administratively you may have many legs to stand on, but I am concerned here with your research career. You may win, but you will find that five years down the people will still be wary of working with you, even if they were on you side. I don't like saying this, and I'd rather believe there are no risks here.
What you want to do is to figure out the strongest case for your work, figure out how to acknowledge and deal with reasons for your low grade or rejection--seriously, and with no rancor. If you threaten the editor, the referee, or the instructor--however subtly--you are likely to discover that your weaknesses as a writer/researcher will become more clearly indicated when people evaluate your career so far. Throwing sand in their eyes will lead to blowback that is likely to disable you.
On the other hand: You could launch a political, bureaucratic, and discipline-wide campaign. You were unfairly dealt with, and others agree with you. But you will surely need legal advice, and and campaign guidance. Stick with the facts you can ascertain. Any speculation needs to be well supported and carefully argued, Usually, this is a long haul. If there is to be bile and insult, find a surrogate to do that work, and stay above the fray.