This is an odd one... for one episode, the writers and producers tried to make The Navy Lark into a dramedy where the main characters play it for laughs while the guest characters play it straight.
If you think you've heard this episode before, you might be mistaken. Certain Navy Lark episode collections substitute "The Forbodians Hijack Troutbridge" for this episode. "The Forbodians Hijack Troutbridge" was aired in March 1970 and contains a Doctor Who joke (Jon Pertwee was hired to play the Doctor in 1969). However, "Spy Catching in Casablanca" was aired on 8 Dec 1961, almost two years before Doctor Who first aired (and with William Hartnell as the Doctor, not Pertwee). Also, "The Forbodians Hijack Troutbridge" features the Padre, a character who didn't exist in 1961.