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.