Randomized trials only look at the benefits of the intervention on the person who is enrolled in the trial. It’s not possible for them to conclude how effectively masks prevent community spread to others — people who are not enrolled in the trial.
To use a randomized trial to measure the effect on the spread of the disease, researchers would have to find a community, divide it randomly into two and cut off all interaction between the two groups. If the communities of mask-wearers interacted with non-mask-wearers, the non-mask-wearers could infect people who would otherwise be protected. The results would be uninterpretable.
There’s more: Scientists would also have to mandate cloth masks for one group, while forbidding cloth masks for the other. But when people see others wearing masks distributed by researchers, they will improvise and make some masks for themselves. Researchers would have to mandate and ensure that people in the mask group wore masks everywhere, while surveilling the other group to ensure they didn’t wear a mask at all. This is not only grossly unethical; it also is just isn’t possible in any experimental conditions I can imagine.