Cedar specifically, not pine, produces oils for several years even when you think it’s dry that deter pest due to their toxicity. In an open air habitat such as an outdoor one this would not be a problem for a lizard or any large animal really. But, in a indoor enclosure such as a glass tank the fumes from these oils and natural pest controls can build up to toxic levels causing respiratory problems and eventually death. In short, “cedar bad.”
I would also recommend staying away from mdf or press board unless it is sealed with something that keeps fumes from the glues used to make it from being release and building up in the enclosure. If you want something durable, cheap’ish, customizable and light weight try making your own backgrounds and hides with foam and drylock.
Pine is okay for building the cage with but my personal preference is oak. You can seal the wood inside with polycrylic or any water-based polyurethane, pond armor epoxy, or drylock. These have all be proven to be safe for the animals. Do not use oil based products however.
The drylock coating is pretty tough unlike the exoterra backgrounds these can take small to medium claws pretty well. If the animal is constantly digging at one spot they might start to chip at it but it’s easily repaired. As far as being too light I design the hides to be partially buried which is why they have removable tops and the walls will also be partially buried. If you have a particularly rambunctious animal you can always attach a heavy base in the form of a plywood bottom also coated in drylock. The drylock also adds a significant amount of weight. Not enough to be considered heavy by any imagination but certainly several times the weight of the original foam. I typically put 3 to four coats of straight white drylock before even add color so there are usually 5 to 6 full coats and then all the highlights probably something like 7 full coats. It sounds like a lot but it’s still only millimeters thick. It’s kind of like a hard candy shell lol. You can also use a product called zoopoxy but it’s a lot more expensive and work.