Removing impurities is really tricky, but that said, it’s not like industry grade equipment and operations are being used here to manufacture it. There may be a simple step or two that would help significantly reduce impurities.
Your comment also made me realize for the first time, a lot of these illicit drugs are made by hobbyists, so to speak, not professional manufacturers. Just knowledge isn’t enough, and I say that as a chemical engineer. If I tried to synthesize anything at home it would have a high degree of impurity – even if I bought some nice lab equipment.
There’s probably a lot of benefit in having the government subsidize a pharma company to make high purity drugs. The impurities could be responsible for a lot of side effects.