Ajar means slightly open. Tom said the door was ajar, openly. Openly means to be direct and honest. We see the word "open" in openly, and "open" describes the door. This joke is playing on the word "openly".
' ' The door ' s ajar , ' ' said Tom openly .