Is it unethical to take a photograph of my question sheets from a sit-down exam I've just finished if I am not allowed to take them home?
Taking a photo is effectively equivalent to taking the question sheet home.
For either of these: it’s not inherently a bad thing, and (as your friend said) it can be good for personal study, and so on. However, it can be used for unethical purposes (passing the questions on to students who haven’t taken the exam yet), so the school have prohibited it. Given this, it is unethical, since it’s breaking a rule (and, moreover, a reasonably justified rule).
If the rules happen to be written in such a way that they just prohibit “taking the sheets home” and didn’t mention photos, then taking a photo may be allowed by the rule as written, but it is clearly still violating the intention of the rule.
So yes, the supervisor’s ruling was reasonable, and you were right to comply with it.
Edit. There is, however, no problem with politely emailing the instructor afterwards and asking if you can get a copy of the exam (or parts of it). No need to mention ethics or taking photos in the email; just say that you’d be grateful to have a copy for your own studying, if the instructor is willing to share it. Maybe the instructor will say yes; maybe no; maybe “yes, but not until next week”. But provided you are polite, and ready to accept a possible refusal, then I don’t think there can be any harm in asking.
The contents of the blank exam, including the questions/formatting/instructions/etc., belong to the person who wrote it. This person retains copyright and all associated rights, unless otherwise given away (or unless otherwise claimed by the employer).
It is irrelevant why the exam's author does not want to permit photography of the exam. Perhaps the author intends to create a book (or paper or patent), in part with this material. Or, perhaps, as the OP speculates, the author intends to create a future exam, in part with this material. Relinquishing a copy of the exam questions may make any of these more difficult in the future.
In the OP's question, the student is granted permission to read the exam, and write answers in the designated areas. However, this does not mean that the student is granted additional rights, such as keeping the exam questions, or photographing them. Doing so infringes on the exam author's intellectual property; doing so after being told not to is a flagrant infringement. It would be very difficult to build a persuasive case that doing so is not unethical.
If you would have taken that photograph, you would have broken a rule to gain an advantage: Even if the exam is not repeated exactly, you gain information as on what kind of questions to expect and you state yourself that you want to use the photographs to your advance (even if this involves honest learning). Taken the photograph would thus have been unfair against those students who comply with the rules and do not have this advantage. This would clearly be unethical.
As the exam is not repeated exactly and the same can be achieved with memorising, you may debate over how bad taking a photograph would be. Also you can debate whether the examinor’s approach to exams – relying on the contents being kept secret to some extent – is a good and effective one. All of this does not however impeach the ethicality of taking a photograph. If you do not agree with the rules, complain about the rules first; do not just break them.