Ghosts pass through solid wall/door. Celebrate finding a key. Unfortunately they cannot remove it from the room as it is solid and cannot pass through matter like they can. Ghosts get depressed about this.
The ghost is sad because it locked itself out/forgot the key inside. Second ghost shows up an tells them to just warp through because they are ghosts. But instead of being happy they are inside and never needed the key, they try to move the key outside so they can unlock the door to get inside.