You may plead your case to your instructor in writing as you have here. Your best option is to demonstrate that you did not get the warning of the first offense until AFTER you had already committed the second offense.
Agree that what you did was wrong. Admit that you did the wrong out of partial ignorance (you knew a rule existed but did not understand its implications fully). Demonstrate that you were given a warning of the first violation only after the second violation had already occurred. Show that you immediately stopped the unlawful action at the warning. Ask that your total penalty be reduced (but not removed) in accord with a plea of doing the wrong from partial ignorance rather than willful intent. See some of these legal readings for insight.
This is not necessarily a criminal case, it is more a civil one. Also, this is not necessarily one where the full implications of the rule were made clear enough at the outset.
On this latter note, since you have read the code now, you absolutely cannot plead ignorance that a code even existed. You can only plead ignorance of the full implications of the code. You should keep your personal story of a need for friendship out of the discussion. You gave the other person the code with the intent to offer insight, not to offer an answer key. You ignored the fact that your action could be easily abused (by a "cheater") and you were ignorant of the fact that such abuse by a cheater had real consequences not only for the cheater but also for you.
Having had cases such as yours multiple times in my career, I am well tuned to the distinction between intent and ignorance. Your instructor may be as well, and he/she may be willing to provide grace with sufficient grounds that remorse is sincere. On the other hand, I am also just as well tuned to spot someone who wants to play games when pleading for reduced penalties. Do not go down that path, lest your instructor is equally well tuned.
Finally, chalk this one up to experience. Some students take a lot longer to have this type of situation hit them. By that time, they often more than deserve the strong penalty that follows. You can now move to the next level of your life with greater confidence that such will not be the case in your future.