The kanji 閑 contains 門 + 木. Why does gate + tree mean 'leisure'?
The word meaning leisure was originally written as「閒」.
「閒」depicts moonlight「月」streaming through a door「門」, indicating the original meaning crack, space. This was extended to mean free time, leisure.「閒」is no longer used, so:
- Space is now written as「間」
- Free time, leisure borrowed the identically pronounced character「閑」.
「閑」is a compound of a wooden obstruction「木」blocking a door「門」, indicating the original meaning fence, railing, obstruction. This meaning is no longer used by the character「閑」, so there is no confusion as to what「閑」means.
閑 is a compound ideogram composed of a gate latched shut with wood. And it meant something like door latch or fencing originally.
Eventually, the meaning of spare time or leisure was borrowed from another kanji that has the same reading, 間. This was pretty common in the history of kanji, for kanji with the same reading to just pick up meanings from each other. So you can't always look at a kanji's elements and just assume there was some intent to express the modern meaning with pictures.
In Japanese, it basically only retains the adopted meaning and associated concepts, like tranquil (as seen in 閑散, 森閑) or negligent (as seen in 閑却, 等閑).