Well for starters, I wouldn't have checked in with mumsnet to ask if I was being unreasonable in carrying on with my day instead of babying a grown adult!
If they only share one set of keys and don't manage it well between themselves, then it's up to them to deal with the consequences, not you. If an $80 locksmith call out is what teaches that lesson, so be it.
If I happened to be leaving just as he was arriving - and I wasn't in a hurry - sure, I would have let him in, though I feel you've earned the right to give him a very pointed look.
Under no circumstances would I have given away my key, regardless of whether I had a spare hidden or not. From what you've described, this isn't a one-off from an otherwise responsible person, so why make their disorganisation or carelessness your problem?
You sound like an empathetic person, in the sense that watching other people make needless mistakes frustrates you. But really, is it the kind of thing that deserves any of your headspace or emotions? Does enhance your life in any way at all? If not, let them get on with it! That's the way we all learn and mature. They've left home and don't need anyone parenting them. Be friendly and a good housemate as always, but no need to act like their parent, guardian or caretaker, or anyone who has to chivvy them along.