It's possible he's had them for quite a while and the count has just flared up recently. They typically come from something that has been in contact with infected poop. Bugs that aren't kept in sanitary conditions, other dragons/reptiles in close contact, licking/eating from infected surfaces etc. Hard to say for sure.
Ok The only thing I can think of is possibly my Dubia. I have a big Tupperware container I keep them in and I take out the bowls that I feed them in day but I’m not sure if I have been cleaning their container often enough that I have produced pinworms. Maybe I should just start over with those at least.
Don't throw your insects away, they are perfectly safe. RWV is good for cleaning everything so yes on that. And just Google " how to give medicine to a bearded dragon " and there will be a demonstration of how to do it on youtube.
Possible ---- put him in a bowl so you get all his weight -- what are you giving for meds? Please dont give him anything w/ out an approval of a vet -- what kind of meds do you have? We need Drache613 or AHBD to advise on this but I am not sure if AHBD can -- Drache613 Tracie would be the one best person to do this ---- please PM her --- @AHBD @Drache613