The simplest explanation is that someone wanted to make fake pills from crushed sweets.
Or they were melting down small candies to make one large one, a la Barry Lewis on YouTube.
Or maybe they were going to use it as filler? Most prescription drugs are mostly filler too, and just micrograms of active substances in many cases. But if you make a tablet of just the active stuff it's too small to handle.
I don't know much about extacy but I assume it's similar?
The result is the same, but most drugs (prescription and otherwise) are more in the milligram range. For ecstacy/MDMA an effective dose is usually on the order of 100mg.
This is almost certainly the "if it's around drugs it is drugs" method of counting; e.g., if you've got 1 gram of $DRUG in a 1 kilogram box, you're prosecuted for 1 kilogram of $DRUG.
Could be to manufacture pills for sale at festivals. By the time subject realises pill was fake sellers are long gone. And usually it's hard to find them at festival site anyway.