Estar en capilla originated from Salamanca University students, who would spen the night prior to an exam in a chapel. Probably because it offered shelter overvthe night. Nowadays, the expression continuecto be used by students waiting for theircturn to take an exam.
Used in US as well
"Los estudiantes de ingeniería están en capilla. Su examen es a las 10."