I was given panacur for pinworms last Friday, but was not told to wash my plants and cage..
My understanding from veterinary advice from one of the best at that time but is now information that is 15 years old so may be out of date-
Most even healthy lizards probably have a few pinworms. But when the lizard is healthy and has a good immune system, most of the time the pinworms are not a problem. At one point it was thought there might even be some benefit to the host, but I have no idea how that speculation turned out- probably not much benefit if any.
Most pinworms are specific to their type of host (in other words, your chameleon's pinworms are probably there from ancestors of the chameleon or other chameleons at the pet shop, etc, rather than contamination in some other way such as original food supply or other pets. Although, from time to time I think about the crickets being counted out by pet shop employees that spend all day in with wild caught lizards).
Pinworm eggs are very tiny and stick to everything. Including hands that move into the enclosure to clean or touch the lizard and then into food supply of the lizard and other cages, etc. Treating the lizard will not remove or harm the pinworm eggs. They are very difficult, maybe next to impossible, to completely remove from the environment without putting the lizard in a completely sterile and regularly sterilized environment for a while (such as a plastic tub set up with disposible limbs or something which are tossed out and the tub sanitized regularly) and then dumping everything and eventually put into a brand new clean terrarium.
That is why you are being told to clean everything and replace. Your vet either believes a more sterile pinworm free environment is better generally or is of the opinion that the levels of pinworm in the lizard are high enough that it is better to start over with a clean environment to give the lizard a break from dealing with them while it recovers and gets it's strength and immune system back up and running.
And that is the same reason the other poster was not told to clean the environment. The vet may have decided the levels were not too severe and therefore routine worming was the way to go and enough to give the lizard a boost against future worms and especially if you are in the habit of bringing pets in for regular health checks, wormings can always be given in the future if the lizard needs them and there aren't so many.
And vets see things different ways- some really want a sterile environment, some either see that as next to impossible to acheive or see benefits to a non-sterile environment (excersize for the immune system if the environment is clean but not sterile). So you can expect some difference of opinion about treatment from that as well.
There are some vets here on the forums that might chime in with advice for you, otherwise, I'd do what your vet says, especially if you are talking about only one lizard that needs plants replaced...