The term in the beverage-opening sense is apparently not an old one; Merriam-Webster finds written attestation only since the 1950s.
The main one is that the ends of some bottle openers resemble the heads of large keys such as have traditionally been used to lock and unlock church doors.
[2] A church key initially referred to a simple hand-operated device for prying the cap (called a "crown cork") off a glass bottle; this kind of closure was invented in 1892, although there is no evidence that the opener was called a church key at that time.
[3] The shape and design of some of these openers did resemble a large simple key.
[4] In 1935, beer cans with flat tops were marketed, and a device to puncture the lids was needed.