Most ciphers — both classical and modern — will work just fine with any key. It's just that, if the key used to dechipher the message does not match1 the key used to encipher it, the output will be essentially nonsense, and the actual intended message will not be revealed.
(Some encryption systems may then detect that the decrypted text is nonsense, often as a side effect of a message integrity check, and may abort with an error indicator instead of returning garbage. But this is strictly secondary to the fundamental operation of the cipher.)
Thus, it's not really correct to say that the key is something "required for the algorithm to function at all" — the algorithm functions just fine with any key (and it's typically easy to make up arbitrary keys), it just functions differently depending on the key.
Indeed, historically, it's pretty clear that the original sense of "key" in cryptography comes from the meaning of "something that permits entrance or access". For example, here's an early quote from Leon Battista Alberti's treatise De componendis cifris (c. 1466), describing the Alberti cipher:
"His peractis inter nos constituetur quem esse indicem velimus; nam index quidem veluti clavis quaedam est qua in penetralia sacrorum intima ingressus pateat. Atqui index ipse duplex est; nam alter est qui ex maiusculis stabilibus litteris constituitur, alter qui ex minusculis mobilibus litteris constituitur, uterque ad arbitrium."
My Latin, alas, is pretty awful, but here's a crude translation I managed to piece together with the help of a dictionary and Google Translate. Improvements and corrections are welcome:
"Having done this, we must choose the index [cipher alphabet]; for this index is indeed like a key that opens the entrance to the innermost sacred shrine. But the index itself is twofold; one part consists of the static majuscule letters, the other of the movable minuscule letters, both of them freely choosable."
This is, in fact, the only place where the word "key" (clavis) appears in the text. It should be clear, even from my clumsy translation, that this somewhat poetic allusion is indeed to a key for opening doors, not to a keystone.
Of course, nowadays this issue is somewhat confused by the introduction of cryptographic tools other than ciphers; in modern cryptography, a key might not be used (only) for encryption and decryption, but also e.g. for signing or authenticating messages.
Yet (even though one might view it as just a terminological coincidence) the same metaphor, properly understood, still works: a key, in modern cryptography, is something that controls access, and the possession of which grants one the ability to do something that should be restricted only to certain individuals — be it decrypting a secret message, signing a document in someone's name, or being granted access to a computer system.
(The metaphor does break down somewhat for public-key cryptography; indeed, I would almost consider the phrase "public key" a contradiction in terms, since everywhere else in cryptography, a "key" is something to be kept secret. Still, it is an established part of modern crypto terminology, and, for want of a better term, it persists.)
See also:
1) For classical ciphers, and for modern symmetric ciphers, the keys need to be effectively identical. For asymmetric (public-key) ciphers, the two halves of the key pair need to have the appropriate mathematical relationship. For example, for RSA, the public and private keys consist of a modulus and an exponent; for decryption to succeed, the moduli need to be identical, and the exponents need to be modular inverses of each other.