I was looking at some Japanese castles lately, and many of them appear to employ predominantly wood construction, for example, the Himeji Castle uses typical construction. Compared to European and Middle Eastern stone and masonry forts, these seem far less defensible - for example, why did they not simply burn to the ground when besieged? There are countless castles that are many centuries old still standing in Japan? Are they more defensible than they seem to a layman? Are they still around due to military custom or political stability?
Actually, there are almost no centuries-old standing castles in Japan. Most of them, as you suspected, were destroyed over the years--and a great proportion of them during World War 2 from all the Allied bombing. Most standing castles are concrete reconstructions from the post-war period, and filled with museum pieces and information, meant as a primer for local history or to boost tourism.
In addition, what most people think of as the "Japanese castle," including many Japanese people, weren't actually built for defense. That style of tall wooden keep extending to the sky is an invention of Oda Nobunaga at the end of the Sengoku period, and he'd already conquered most of the country at that point. From that time on, castles were still constructed, but they were done so with an eye for projecting status and power, as well as providing a home for local lords and a center for local government.
Going back before then, there was still some variation in castle construction, because it depended on the geography and purpose of the castle. Was it to protect a trade route? Was it to guard a river ford or mountain pass? Was it to project power? These things influenced how much attention was paid to defensibility.
But in general, castles consisted of wooden keeps standing on high ground. This alone proved to be quite defensible; you try running up a steep hill as fast as you can and see how far you get, to mention nothing of doing so while people are trying to kill you with swords and arrows and guns and hot sand along the way. Especially when they have the high ground and solid walls and can use them to attack you without having to worry terribly much about your ability to retaliate. And there are usually constructed barriers and caltrops along the way to impede progress, as well.
The number one defense of Japanese castles, however, was simple architecture. By building baileys and courtyards in clever ways, castle designers forced invaders to take the most tortuous and difficult route possible, rarely in straight lines, and requiring them to thin their ranks and present a small front. In fact, it was common to have switchback staircases extending slightly within the ramparts and arranged horizontally so that not only would enemies have to fight up stairs (monumentally difficult on its own), but they would have to do so completely exposed to anyone on nearby walls who wanted to poke or shoot at them. This particular design feature also made it incredibly difficult to use siege weapons that were common in European medieval wars. Moreover, each bailey tended to be gated and heavily defended and defensible. They don't even have to be arranged concentrically. A good example would be Katsuren Castle in Okinawa, which is essentially cliffside, and has three gated courtyards in a row extending from the keep down the scalable hillside.
As far as the problem of wood construction goes, it's much less of a problem than you might think. For more information, see this previous post by /u/willOTW.
Tagging on to /u/churakaagii's answer - I've talked about this a bit more here.