As long as a bee hive provides protection from the wind and wet, it does not matter much to the bees what material is used in its construction so this is largely a choice of the beekeeper.
Light weight, low density timber is preferable not only for the ease of use for the beekeeper but also, more importantly, because it has lower thermal conductivity providing better insulation for the bees. Heavy or dense timber or board should therefore be avoided as should any preservative dipped or pressure treated timber. The persistence of plastics and polystyrene foam and their adverse effects on nature and the environment are well known - just one reason why we also avoid plastic or polstyrene bee hives.
No matter what material is used in construction, the exterior surfaces of a bee hive must have a water repellent treatment. A wet bee hive is a severe disadvantage to the bees, they will use their energy to dry it out - stand outside in wet clothes and you will quickly understand the adverse effect.
Bee hives must also be kept off the ground. Concrete slabs or blocks and hive stands can be used which also bring the hive to a more convenient working height.
There are many ways of weather proofing and protecting the timber according to your taste, from natural oils to paints and stains. Only apply product to the exterior surfaces of the bee hive (the bees take care of the interior) and allow plenty of time for the hive to dry and air out before populating.
Timber beehives correctly treated and regularly maintained should last years although we have hives in our apiaries that are decades old.